Icons for Shortcuts in a Setup File

by Jim Aug 21, 2006 8:49 PM

Visual Studio's setup projects are very powerful, but it can be a chore figuring out how to accomplish some of the things they can do.

It's simple enough to add shortcuts to the user's start menu, but the default icon is the little page icon you see in Visual Studio.

Some people mistakenly think that you need to add the icon file itself to the target machine's application folder in order to get the shortcut to show with that icon. Not so! For the shortcut to the application's executable:

  • Click on browse in the shortcut's icon property
  • Browse again in the icon dialog
  • Switch the file filter to *.*
  • Choose the executable from the application folder
  • Choose the appropriate embedded icon from the executable

The help file icon is where it gets tricky. The .CHM file doesn't have an embedded icon.

  • Add the windows help executable to your application folder; this is C:\Windows\hh.exe, depending on your system
  • In the properties for hh.exe, set Exclude to "true"; this will prevent the file from being placed on the user's machine during install. It will also not be visible in Visual Studio, but it's still there!
  • Follows the steps for setting the application icon; this time you'll find hh.exe listed in the application folder
  • Choose hh.exe as the source of your icon