cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
heko_76
Level 4

icons not displaying Add/Remove Programs

Hi,

I am using Installshield professional 2008 with windows vista as OS.I am using the following function to display icons in Add/Remove Programs. But it gives error cannot create it and gives the error message "Unable to create the Add/Remove icon"

Alternatively i also went through General Information -->Add or Remove Programs--> and gave the icon path it only worked when i gave location of the icon on my machine such as Display Icon value as SUPPORTDIR ^ "Sample.ico" and the icon index as 0.
I am using Installscript project...

But when i executed the setup it doesnt display in the Add Remove programs list.Kindly help....



prototype ChangeAddRemoveIcon();
function ChangeAddRemoveIcon()
STRING szIcon;

string szKey;
begin
szKey="Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + PRODUCT_GUID;

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szIcon = SUPPORTDIR ^ "\Sample.ico";
if (RegDBSetKeyValueEx(szKey, "DisplayIcon", REGDB_STRING, szIcon,-1) < 0) then
MessageBox("Unable to create the Add/Remove icon",0);
endif;
end;
Labels (1)
0 Kudos
(1) Reply
mr_slava
Level 4

There are few things you may want to take a look on.

- In your code you are setting the icon file path to SUPPORTDIR. This location available ONLY during installation and will be removed when installation ends. The icon file won't be displayed, because will be removed. If you want to display custom icon you need to install it with application. Usually ppl use icon from main executable, because it will be installed on the system and will be available.
- In your code you use HKLM to set Default Root, but I think it depend on type of installation ( for all users or for me only ). You may want to use "HKEY_USER_SELECTABLE" to set the root. In this case the root will depend on ALLUSERS value and will be installed into correct root.
- Last thing what you may need to verify is for Vista your installation process should run elevated in order to write into HKLM.

Hope you'll check this points and it will be helpful.
0 Kudos