Old 6th November 2012, 10:52   #1
leon_20v
Junior Member
 
Join Date: Nov 2012
Posts: 3
Change Icon from .exe in $installdir

Hello,

i am from germany and i hope you will understand me.

I like to change the ICON from the "application.exe" when i compile the NSIS-Script-File. If the user installs the program he only could see the changed icon in Windows Explorer. That´s what i will do.

I heart, i can include the resource hacker in a nsis script to do this. But i didn´t find a example code for changing an icon.

Thanks a lot
leon_20v is offline   Reply With Quote
Old 6th November 2012, 12:10   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
So you want to take an existing .exe file, and change the icon it shows in Explorer, from inside NSIS?
MSG is offline   Reply With Quote
Old 6th November 2012, 12:14   #3
leon_20v
Junior Member
 
Join Date: Nov 2012
Posts: 3
if it is possible, yes

after that i will compile all in installdir to an nsis-installer.
leon_20v is offline   Reply With Quote
Old 6th November 2012, 18:57   #4
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Why do this at install-time? Why not change the icon of the EXE before building the installer?

I don't know how you compile the EXE file that you are going to deploy with your NSIS installer, but if you build with Visual Studio, for example, chaining the icon in an automated way should be straight forward by modifying the .RC file before calling MSBuild.

And, if the decision what icon is needed can only be drawn at install time, them simply package several variants of the EXE file (each with different icon) in your installer and then pick/extract the desired one...

(Adding more EXE files to the installer that only differ from the "main" EXE by their icon should compress to ~0 bytes)

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 7th November 2012, 06:34   #5
leon_20v
Junior Member
 
Join Date: Nov 2012
Posts: 3
why: the program has more distributions. for each distribution is one xml file which is loaded at lifetime. and each distribution should have a different icon. so i thought the easiest way to do this, is changing the icon with an resource hacker for each installer. but there are many distributions so this should be done automatically.

So i have to move my program in dlls and for each distribution i must make a new project which has only one main and the icon? There is now way to do this with nsis? i thought this could be done becouse nsis can replace the icon from shortcuts.

thanks a lot!
leon_20v 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