Archive: Change Icon from .exe in $installdir

Change Icon from .exe in $installdir

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 :)

So you want to take an existing .exe file, and change the icon it shows in Explorer, from inside NSIS?

if it is possible, yes :)

after that i will compile all in installdir to an nsis-installer.

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)

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! :)