首页 > 解决方案 > 使用 NSIS zip 文件夹安装特定依赖项

问题描述

所以我的项目是基于 python 的,我已经为它创建了 .exe 文件pyinstaller

现在我有一个文件夹,其中包含

我能够制作一个可执行文件,它将安装与 main.exe 相关的依赖项,使用NSIS. 但是为了让我的项目正常运行,我需要安装另一个名为GhostScript的软件。

我想知道 NSIS 本身是否有办法这样做。就像它安装依赖项时它也会自动安装一样GhostScript

注意:它适用于 Windows 应用程序

标签: pythonwindowsnsisghostscript

解决方案


Ghostscript也使用 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

推荐阅读