您的位置:首页 > 其它

SUPPORTDIR的使用(version:Installshield develpo8.0)

2014-05-18 08:11 429 查看


目的

一些文件,在安装过程中使用,在安装结束后从目标机器上删除。那么这些文件应该放在安装工程的哪里呢?


分析

以licence.txt(安装过程中常见的版权声明之类)为例寻求,因为这个文件亦是只在安装过程中需要的,安装过程结束后删掉。

★帮助SUPPROTDIR中的说明

SUPPORTDIR
During setup initialization, InstallShield Developer locates a folder on the target system into which it can copy temporary files and files that were compressed into your setup. InstallShield
Developer assigns to SUPPORTDIR the fully qualified path to that folder.
In addition, files you add to the Language Independent (or language-specific) file list in the Setup Files view of the IDE are decompressed into SUPPORTDIR when the installation initializes, and
are deleted when the installation is complete.
http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q105378&sliceId=SUPPORTDIR
SUPPORTDIR Read-only property set tTempFolder ^ ProductCode

  安装期间,InstallShield Developer 定位到目标操作系统的一个文件夹,这个文件夹拷贝临时文件、你安装用到的压缩文件。InstallShield Developer 用SUPPORTDIR代表这个文件夹的完整路径。对应关系:你在IDE的Setup Files view中添加到(依据语言不同的)文件列表中的文件,在安装期间被解压缩到SUPPORTDIR路径,在安装完成时删除。

★SUPPORTDIR的值的探究

  未作任何操作的情况下,跟代码跟出SUPPORTDIR ^ "license.txt"的值是

C:\DOCUME~1\计算机当前用户名\LOCALS~1\Temp\{45689493-8BCE-464F-807A-B7C7E9BB3910}\license.txt


  想必这里就是预先给我们安排的临时文件夹了。存储那些临时文件、压缩文件等等。其中{45689493-8BCE-464F-807A-B7C7E9BB3910}是Products Code。安装过程中观察(未作什么设定的情况下)这里现在存储了这些:_ISRES.DLL _ISUSER.DLL IGdi.dll IsConfig.INI ISRT.DLL setup.inx String2052.txt安装结束后,{45689493-8BCE-464F-807A-B7C7E9BB3910}文件夹被删除。以上,印证了帮助中所说的。

★把license.txt放在哪里?

  那些想在安装过程中使用到的文件究竟放在哪里,才能在调用时拷贝到SUPPORTDIR目录下呢。帮助SUPPORTDIR中如是说: “files you add to the Language Independent (or language-specific) file list in the Setup Files view of the IDE” 这个地方在哪?而且这个是应用多语言时的一种策略吧。

  我还找到帮助中的另一主题。找到了一个词Support Files view,看来各种临时文件可以在这里添加到我们的安装工程中去。

How do I place a file in the .msi database and extract it during run time?
  Adding a License File

  You can add a text file containing a license agreement in the Support Files view (for example, License.txt).

  Add the file under the appropriate language node. If the file is to be associated with all project languages, select the Language Independent node.

  Call the file in the szLicenseFile parameter in the function in your script (for an InstallScript MSI project) or in an InstallScript (for a Basic MSI project).

  注意红字部分,我们可爱的license.txt文件就是放到这里,就可以在安装时被调到临时文件夹SUPPORTDIR中,在安装后被删掉了。期间我们就可以在代码中call the file了。

结论

  Behavior and Logic-->Support Files/Billboards-->终于找到了我魂牵梦绕的Setup Files树,在Language Independent结点上加上我在安装过程中需要(安装结束后就删掉)的全部文件吧!(PS:中英文不同的license.txt应该放在不同的语言结点下面呢?是的)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: