python - 使用 NSIS zip 文件夹安装特定依赖项
问题描述
所以我的项目是基于 python 的,我已经为它创建了 .exe 文件pyinstaller
。
现在我有一个文件夹,其中包含
main.exe
文件README.txt
我能够制作一个可执行文件,它将安装与 main.exe 相关的依赖项,使用NSIS
. 但是为了让我的项目正常运行,我需要安装另一个名为GhostScript的软件。
我想知道 NSIS 本身是否有办法这样做。就像它安装依赖项时它也会自动安装一样GhostScript
。
注意:它适用于 Windows 应用程序
解决方案
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
推荐阅读
- elasticsearch - 嵌套对象的术语聚合表现不佳
- java - 如何在 ARCore 中放置 3D 盒子
- loops - 如何编码 python/pyspark if 语句(中等/硬复杂度)?
- jmeter - 用于从请求方法中的 URL 中提取值的后处理程序
- c++ - 为什么允许将 std::begin(v) 缩写为 begin(v) 作为 std::find() 的参数?
- python - Spyder 5(独立)- 不启动
- android - 验证后如何登录 Vimeo
- java - 如何使用 Spring Cloud Stream 将 RabbitMQ 中的消息直接发送到队列
- c# - 仅在函数中评估传递的对象
- python - 使用未检测到的 chromedriver + selenium,python 打开第二个窗口