我想做一个自解压缩的exe(abcdInstaller.exe),它运行另一个exe(AppInstaller.apk,这是在我的pc上安装abcd.apk )。下面的脚本运行良好,但当我运行abcdInstaller.exe时,它也会在当前目录(从我运行这个exe的位置)提取这两个文件并运行AppInstaller.exe。
但是我想要的是,用户只需点击abcdInstaller.exe,abcdInstaller.exe就会在后台运行AppInstaller.exe,这将完成它的工作。
!include LogicLib.nsh
!include WinMessages.nsh
SilentInstall silent
RequestExecutionLevel user ;no elevation needed for this test
ShowInstDetails hide
# this will be the created executable archive
OutFile "abcdInstaller.exe"
InstallDir $EXEDIR
# the executable part
Section
# define the output path for the following files
SetOutPath $INSTDIR
# define what to install and place it in the output path...
# ...app...
File AppInstaller.exe
# ...and the library.
File abcd.apk
# run application
ExecShell "open" "AppInstaller.exe"
# done
SectionEnd我试图评论SetOutPath $INSTDIR,但后来什么也没发生。
请给我一些建议。
发布于 2016-03-02 11:12:33
对于安装过程中临时使用的文件,您应该使用$PluginsDir:
SilentInstall silent
RequestExecutionLevel user
OutFile "Test.exe"
Section
InitPluginsDir
SetOutPath $PluginsDir
File "MyApp.exe"
ExecWait '"$PluginsDir\MyApp.exe"' ; Double quotes on the path
SetOutPath $Temp ; SetOutPath locks the directory and we don't want to lock $PluginsDir
SectionEnd发布于 2016-03-02 07:32:32
我在更新我的解决方案。
我正在将exe复制到临时文件夹,并在完成该过程后删除该文件夹。
!include LogicLib.nsh
!include WinMessages.nsh
SilentInstall silent
RequestExecutionLevel user ;no elevation needed for this test
ShowInstDetails hide
# this will be the created executable archive
OutFile "ABCD.exe"
InstallDir $EXEDIR
# the executable part
Section
# define the output path for the following files
SetOutPath $TEMP\ApkPath
# define what to install and place it in the output path...
# ...your app...
File AppInstaller.exe
# ...and the library.
File xyz.apk
# run your application
ExecWait "$TEMP\ApkPath\AppInstaller.exe"
SetOutPath $TEMP
RMDir /r $TEMP\ApkPath
# done
SectionEndhttps://stackoverflow.com/questions/35731594
复制相似问题