Archive: My installer's icon


My installer's icon
I want my finished installer to have an icon different than the default. I have searched the forum and found related topics but I do not understand the solutions I found.

Reading through the help file I see a command titled "Icon" used in the installer attributes section. It reads as though this is what I need to use in order to create a custom icon for my installer. So I place the Icon command in the "General" section of the script with a valid path to the ico file. Everything complies just fine but I do not get my custom icon used for the installer.

Searching the forum I see another command: !define MUI_ICON
I add this to the "General" section of the script:

!define MUI_ICON "C:\Myapp\myicon.ico

This complies until it gets to the Uninstall section and then fails with an error about how my uninstall icon needs to match my install icon. OK, so I add the same line to the uninstall section of the script. This yields another error about MUI_ICON already being defined. OK, then how do I add the icon I added for the installer to the uninstaller? Is that what the problem is?


I tried adding the following to the General section to overcome this issue without luck:

icon "C:\Myapp\app.ico"
UninstallIcon "C:\Myapp\app.ico"

No error during compile but also no custom icon. Why? My installer file size is only 4.9M.


You need to use MUI_UNICON to define the uninstaller's icon. The MUI replaces the default icon, so using Icon and UncinstallIcon might be overridden by the MUI, as you've already seen.

In the next version, NSIS won't care about matching sizes of the installer and the uninstaller icons, so they'd be easier to replace.