MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: HtmlDirTable[Next]: Ini
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->Icon

The "Icon" Command

This command adds a file to the MSI "Icon" table.

The icon file should ideally only contains icons it should not be a large execuable which just happens to contain icons (see the "Icon Tools" section for more information).

The macro takes these parameters:

Icon Alias

Sometimes you will need to specify the exact key that needs to be used for an icon although this is likely to be rare.

All Windows versions have an icon caching bug which may prevent your new icon being displayed on a users computer if they had previously installed your product, a minor issue but a very annoying one. A workaround is to always use icons with different names and as windows installer uses the icons "key" when creating the file you need to vary the key.

The alias facility serves two purposes, you don't need to know what the key will be and a variable key can be produced to work around the windows icon bug.

The alias can be referred to with the "ICON" parameter of the "Shortcut" command. The alias is case sensitive but may include any character.

Windows Bugs

  1. ARPPRODUCTICON #1
    There is a well known Windows Installer bug which can prevent the icon being displayed in the control panel's Add/Remove Applet. This occurs if an MSI was installed per-user (the MAKEMSI default is per-machine).

  2. ARPPRODUCTICON #2
    If this property is not set at all then I have seen Windows Installer (on Windows XP) incorrectly grab the first entry in the "Icon" table and use it!

  3. Icon Handling Caching
    By this I don't mean the well known problem Windows has always had simply caching icons (hence all the work arounds tools etc), what I mean here is that once an icon has been used such as "fred.ico" and you change "fred.ico", it can be very reluctant to pick up the new icon (seen/tested in Windows 95-2000).

    If you change the icons look and this does not get reflected in the installed product's shortcuts etc, you have two alternatives, rename the icon (use a different key - one way is to use a "alias" - see above) or put up with it (it will look OK when installed on clean machine).

  4. Icon Bloat validation Message
    The validation warns where an icon exists which it doesn't believe is used by shortcuts etc. It reports this as it is just wasting space, however it doesn't recognise that its in use if its only used as a product icon.

  5. Icon Table keys longer than 57 bytes corrupt the Database!

EXAMPLE

<$Icon "test.ico" Key="test.ico.exe">


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: HtmlDirTable[Next]: Ini


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.