我正在使用以下 NSIS 脚本:
Name "My app wrapper"
Outfile "MyAppSetup.exe"
InstallDir $TEMP\MyApp\Install
Function .onInit
SetSilent silent
FunctionEnd
Section ""
SetOutPath $TEMP\MyApp\Install
File installer.msi
File setup.exe
Exec setup.exe
SectionEnd
其目的是安装程序会将 installer.msi 和 setup.exe(这是安装先决条件然后调用 installer.msi 的引导程序)这两个文件打包到 MyApp Setup.exe 文件中。运行 MyAppSetup.exe 时,它应该将 installer.msi 和 setup.exe 提取到 $Temp\MyApp\Install 目录,并且应该从该目录运行 setup.exe。
但是,当我从桌面运行 MyAppSetup 时,它会执行在桌面上找到的 setup.exe 文件,而且我什至在 C:\Temp 中看不到 MyApp\Install 目录。
我需要做什么才能让这个脚本将文件安装到正确的位置并执行正确的文件?
Section
InitPluginsDir
SetOutPath "$pluginsdir\MyApp\Install" ;It is better to put stuff in $pluginsdir, $temp is shared
File installer.msi
File setup.exe
ExecWait '"$pluginsdir\MyApp\Install\setup.exe"' ;You should always use full paths and proper quotes
SetOutPath $exedir ;Change current dir so $temp and $pluginsdir is not locked by our open handle
SectionEnd
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)