How to change the setup.exe icon

Ralph JansenIf you create an application, you have also create an installer project. The installer creates two files for you. An setup.exe file and a msi file. The icons of the two files are set by the default windows icons. In Windows 7 it looks like this: image

If you want to change the icon of the installer, you can not do that by default in your installer project. Also, the icon of the msi file can not be changed at all. For the setup.exe file you have to do it manually for each time you create a new installer. So every time you fix a bug and releases a new version of your application by the new created installer you have to set the icon manually. Lucky that this is not hard to do.

Change the icon

  1. Create an installer project with the right settings that you want and build it.
  2. Now open the setup.exe file in the release folder (that is the one that you want to give to your client) in Visual Studio. You can do this as follow:
    1. Click in Visual Studio on File –> Open –> File
    2. Navigate to the exe in the release folder
    3. Click open and then you will see an explorer in Visual Studio
      image
  3. Right click with your mouse on the icon folder and choose “Add Resource…”
  4. The icon type is now selected by default. Choose on the right of the popup for “Import”
  5. Navigate to the right icon that you want and select it
  6. The popup will now close and the icon folder in the explorer is expanded
  7. Make sure that your new icon has the lowest ID. If you don’t do that, the icon will not been shown
    image
  8. Save the setup.exe and return in Windows Explorer to the release folder. You should now see the new icon.
    image