【问题标题】:Install a specific dependency using NSIS zip folder使用 NSIS zip 文件夹安装特定依赖项
【发布时间】:2021-06-30 18:19:15
【问题描述】:

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

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

  • main.exe文件
  • README.txt

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

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

注意:它适用于 Windows 应用

【问题讨论】:

    标签: python windows nsis ghostscript


    【解决方案1】:

    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
    

    【讨论】:

    • 非常感谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-03
    • 1970-01-01
    • 1970-01-01
    • 2020-11-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多