Archive: Add Icon to NSIS created setup.exe file


Add Icon to NSIS created setup.exe file
Greetings,

I've searched for this, unable to find info.

How do I add custom icon to the actual nsis created setup.exe file?

I'm not refering to the nsis setup screen that shows nsis icons in the gui, but rather I'm refering to the actual image "attached" to the setup.exe when viewed on the hard drive or CD disk. Currently by default, it shows blue top with white center, I have my own icon that I would like to use in place of this default icon.

Upon review of existing posts, it's possible I'm experiencing loss of icon due to setup size, currently it's 476 KB. Hmm ... still looking for solution.

Any suggestions?

Thks.


The command is:

!define MUI_ICON "C:\Build\nsis.ico"

add it right after the the command:

!include "MUI.nsh"

does this help?

There are also limitations as the dimensions (pixels) and the number or colors. You may be exceeding one of those.


Thks for the tip. However, it didn't resolve it. I originally had MUI.nsh above the MUI_ICON. I'm using standard nsis icon, so it's not icon image issue. At best, it's most likely the issue of setup.exe file size at 467 KB. Not sure when it looses it though. Hmm ...


Hi bd2005,

you're asking quite much basics (which are already answered).

First you should read the fine NSIS manual which is very handy. It includes some MUI appendix.

Then I suggest you look into the
NSIS-Archive where you can find many scripts ready to use and many additional functions.

And after that: Please search this forum with keywords.

To make this post not so flamy I add some code snippet :-)


!include "MUI.nsh"
!define MUI_ICON "setup.ico"
!define MUI_UNICON "unsetup.ico"
OutFile "test.exe"


works for me just fine, try this with icons supplied with NSIS.

Yes, I've searched this forum and tried the tips. There were some that I didn't understand, thus didn't try it.

As for this tip you submitted, Yes, I already have all of this code in it, didn't resolve it. The exe file is 467 KB, why would the size affect the icons?

It looks like the icon was there up until 426 KB, then once it got to 467 KB, disappeared. Hmm ...

STB, Thanks for providing this tip. Got another idea?

BD


Try the icons supplied with NSIS. If that works fine (it does for me) then probably your icon maybe is broken or not compatible. It's unlikely the size matters.


Size matters only if it's over a few hundred megabytes. In this case, Windows simply ignores the icon for an unknown reason. It probably does this to save the time of reading the file. But if your installer is less than one megabyte, it shouldn't matter.


I've been using both nsis and my own professional icons ... Well ... crap ... Is there workaround to fix it? ... It looks ugly not having professional icon with it.


My error ... it's 467 MB not 467 KB.

Hmm ... Windows Explorer does not show the icon, but Hex editor program "open file" does show the icon in the search for exe popup window. Hmm ...


You should check on another system.