Old 9th April 2005, 04:11   #1
bd2005
Junior Member
 
Join Date: Apr 2005
Posts: 19
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.
bd2005 is offline   Reply With Quote
Old 9th April 2005, 04:20   #2
Jnuw
Senior Member
 
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
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.
Jnuw is offline   Reply With Quote
Old 9th April 2005, 04:43   #3
bd2005
Junior Member
 
Join Date: Apr 2005
Posts: 19
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 ...
bd2005 is offline   Reply With Quote
Old 9th April 2005, 08:28   #4
stb
Senior Member
 
Join Date: Mar 2004
Location: Germany, Paderborn
Posts: 177
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 :-)

code:

!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.
stb is offline   Reply With Quote
Old 9th April 2005, 14:54   #5
bd2005
Junior Member
 
Join Date: Apr 2005
Posts: 19
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
bd2005 is offline   Reply With Quote
Old 9th April 2005, 16:28   #6
stb
Senior Member
 
Join Date: Mar 2004
Location: Germany, Paderborn
Posts: 177
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.
stb is offline   Reply With Quote
Old 9th April 2005, 16:36   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 9th April 2005, 17:00   #8
bd2005
Junior Member
 
Join Date: Apr 2005
Posts: 19
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.
bd2005 is offline   Reply With Quote
Old 9th April 2005, 17:06   #9
bd2005
Junior Member
 
Join Date: Apr 2005
Posts: 19
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 ...
bd2005 is offline   Reply With Quote
Old 9th April 2005, 17:11   #10
stb
Senior Member
 
Join Date: Mar 2004
Location: Germany, Paderborn
Posts: 177
You should check on another system.
stb is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump