【问题标题】:Installer icon customization with NSIS使用 NSIS 自定义安装程序图标
【发布时间】:2018-01-08 13:35:38
【问题描述】:

我正在使用 NSIS 创建安装程序。现在,输出文件 installer.exe 具有标准图标,可在以下位置找到:

{NSIS_Install_Dir}\Contrib\Graphics\Icons\classic-install.ico

我想用一个自定义的地雷来改变它,所以我按照文档的建议添加了这些行:

!include "MUI.nsh"
!define MUI_ICON "custominstaller.ico"
!define MUI_UNICON "custominstaller.ico"

它不起作用,在 NSIS 编译结束时,我可以阅读 2 个警告:

2 warnings:
  Variable "MUI_TEMP1" not referenced or never set, wasting memory!
  Variable "MUI_TEMP2" not referenced or never set, wasting memory!

我尝试使用 MUI2.nsh,但没有真正改变(只是新警告)。我也尝试使用图标的完整路径,仍然没有。 我什至将一个标准 NSIS 图标 (arrow-install.ico) 复制到 C:\ 并将其引用为

!define MUI_ICON "C:\arrow-install.ico"

还是什么都没有。有什么提示吗?

我在 Windows 7 机器上使用 NSIS 3.01。

【问题讨论】:

    标签: installation uninstallation


    【解决方案1】:

    在这里回答我自己的问题,终于找到了答案。
    我使用的是 MUI2.nsh,强制插入宏 MUI_LANGUAGE,例如:

    !insertmacro MUI_LANGUAGE "English"
    

    没有它,插件将无法正常工作。文档中没有说明这一点很荒谬,但就是这样。

    来源:A heap of warnings and no image on the welcome/finish page

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-26
      • 2012-10-05
      • 2013-10-22
      • 2012-04-13
      • 1970-01-01
      • 1970-01-01
      • 2012-02-12
      • 2020-03-08
      相关资源
      最近更新 更多