简体   繁体   中英

Installer icon customization with NSIS

I'm using NSIS to create an installer. Right now the output file installer.exe has the standard icon that can be found at:

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

I want to change it with a custom mine, so I added these lines as the documentation suggests:

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

It doesn't work, and at the end of NSIS compilation I can read 2 warnings:

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

I tried using MUI2.nsh but nothing really changes (just new warnings). I tried also using the complete path to the icon, still nothing. I even copied one of the standard NSIS icons (arrow-install.ico) into C:\\ and reference it as

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

still nothing. Any hint?

I'm using NSIS 3.01 on a Windows 7 machine.

Answering my own question here, finally I found the answer.
I'm using MUI2.nsh and it is mandatory to insert the macro MUI_LANGUAGE , for example:

!insertmacro MUI_LANGUAGE "English"

Without it the plugin will not work properly. It's ridiculous that this is stated nowhere in the docs, but that's it.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM