changing icon within Add/Remove Program
Posted 12 March 2003 - 18:34
I run couple of setup.exe back to back through a program of my own. Now what I'm experiencing is that under Control panel's Add/Remove Program folder, both the products have the same icons.
Where and How do you specify in your setup, which icon is to be used?
Posted 12 March 2003 - 21:36
of type string whose value is the full path to an icon file (.ICO) or an executable (.EXE).
The <InstallGUID> is set on a per-project basis and can be retrieved by opening your IS project and going to Project | Settings, choosing the Application tab, and noting the value of the GUID field.
Also, there's no built in way to configure this item through IS, so you'll simply need to create this registry value during install time. I'd suggest at the end of OnFirstUIAfter.
Finally, if want to see how it works, install your product and then play around with the registry before adding the code to your setup.
Hope it helps and have a good day.
NOTE: The icon information does NOT apply to NT4, but adding it won't hurt. It just won't be displayed/used. Not sure which Win9x/Me setups make use f it since I haven't done very much with those, but same idea. Having this extra information won't hurt.
Posted 12 March 2003 - 22:00
I will play with your suggestion and am quite sure that your answer will work.
Posted 14 March 2003 - 16:17
I've found the following code works for any O/S which makes use of the icon:
#define UNINSTALL_KEY_BASE "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"
#define UNINSTALL_KEY UNINSTALL_KEY_BASE+PRODUCT_GUID
// Set Icon to be displayed in 'Add/Remove programs'
nvRegValueType = REGDB_STRING;
RegDBSetKeyValueEx(UNINSTALL_KEY, "DisplayIcon", nvRegValueType, TARGETDIR ^ @PRODUCT_KEY + "," + @ICON_ORDINAL, -1);
Where PRODUCT_KEY is the name of the exe I want to use and ICON_ORDINAL is the zero based icon refernce to the exe file. They are strings defined in my string table.
I call this common code from all my installs and it works for me on 2000 & XP. As I recall ME & 98 do not make use of the icon.
Hope this is useful.
Posted 14 March 2003 - 16:43
@Ray Gonzales: For future reference, the Code tags are useful for embedding code in a post. Check 'em out.
Posted 17 March 2003 - 20:58
Posted 18 March 2003 - 22:19
The code works. What I did was made a function which takes the icon file name as its parameter and got the job done.
if (sIco != "") then
DestString = TARGETDIR;
sIco = DestString + "\\" + sIco;
DestString= "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + PRODUCT_GUID;
RegDBSetKeyValueEx (DestString , "DisplayIcon" , REGDB_STRING_EXPAND, sIco, -1);
Pretty much this takes care of the reusability that Gonzales is talking about
Thank you everyone for your help.