Visual Studio Installer Project: Installer and Application Icons

7.9k Views Asked by At

I've got an icon for one of my applications, which I've embedded in a resource file and is used as the main icon for the application. So far so good.

However, I want to use the same icon for the installer project, and for the shortcut that the installer places in the Start Menu. I can set the icon for the installer package itself, but only if I add the icon as an .ico file in the main application folder.

The whole point of embedded the icon in a resource file is so that I don't have an ICO file floating around in Program Files. I can't access the resource file from the main project in the installer project - is there some trick that I am missing?

Secondly, even if I include an icon in the main folder, if I set the menu short cut to use it, it doesn't - it shows the standard shortcut icon both in the IDE and in the menu after the program has been installed. Again, am I missing a trick here?

3

There are 3 best solutions below

3
On BEST ANSWER

I have no time to test it now, but when you browse for an icon you will be presented with a dialog that lets you choose items that will be on the target computer. At the bottom of the dialog is a dropdown that lets you select the file type. If you choose EXE (or possibly DLL), then you primary project output(s) will show. Once you select that you can chose any embedded icon that your project output contains.

(What I did not test: If the icons actually show after you installed your software on a test computer.)

1
On

The size of your icon should be between 10 kb - 40 kb. Otherwise it wont show up.

Thanks, Anshul

0
On

No solution described above worked for me, including the commercial web convertor.

Finally, I read this in the MS documentation about createing ICO files:

In order to display properly in Windows Explorer, ICO files must be saved-down to 24-bit and 8-bit color depths for each image size.

It seems to be related, because when I set all 3 images within ICO (16x16, 32x32, 64x64) to 24b depth, the resulting 37 KB file worked and icon started to show on the desktop. No compression used. And I did it in GIMP, so it's not a GIMP issue, but the settings. And it works with both EXE and ICO type (so both from installed project output and the installer project output) of output in the "Add file" dialog.