问题描述
所以我的项目是基于 python 的,我已经使用 pyinstaller
为它创建了 .exe 文件。
-
main.exe
文件 README.txt
我能够制作一个可执行文件,该文件将使用 NSIS
安装与 main.exe 相关的依赖项。但是为了让我的项目正常运行,我需要安装另一个名为 GhostScript 的软件。
我想知道 NSIS 本身是否有办法做到这一点。就像安装依赖项一样,它也会自动安装 GhostScript
。
注意:它适用于 Windows 应用
解决方法
Ghostscript also uses NSIS 因此它支持与其他 NSIS 安装程序相同的静默安装开关。
InstallDir "$ProgramFiles\MyApp"
RequestExecutionLevel Admin
Page Components
Page Directory
Page InstFiles
!include LogicLib.nsh
Section "Ghostscript"
InitPluginsDir
File "/oname=$pluginsdir\gsinst.exe" "gs9540w32.exe"
ExecWait '"$pluginsdir\gsinst.exe" /S' $0
${If} $0 <> 0
MessageBox mb_iconstop "Unable to install Ghostscript!"
Abort
${EndIf}
SectionEnd
Section
SetOutPath $InstDir
File main.exe
File Readme.txt
SectionEnd