
setting IFX_PRODUCT_ICON
Posted 23 March 2011 - 16:01
So we have an installscript project which does not have an icon for add remove programs. I would like to add one. I started searching for how to do so and came across the IFX_PRODUCT_ICON variable / registry information in the Install script language reference pdf. However, I cannot find an example of how or where to set this properly.
Can anyone give me an example of what this should look like?
I even found another thread which mentions this as a solution to the same problem but with no details on how to do it. http://community.sof....799#post420799
Posted 23 March 2011 - 16:52
If you want to set it in script I guess (haven't tried) it would be something like:
IFX_PRODUCT_ICON = SUPPORTDIR ^ "your.ico";
Your .ico file must be added to the support files section.
Stefan Krüger
InstallSite.org twitter facebook
Posted 23 March 2011 - 18:27
So I did not find specifically how to set the variable but I did discover a few other things about Install script projects.
If you set the icon for the add/remove programs under the general information it is ignored if you do it the same way you would in MSI projects. That is to say you are pointing to a location on the machine with IS on it and not a target dir on the machine the software is being installed on. It does not appear to embed the icon in the installer the way an MSI project does.
The icon needs to be copied to the target machine and the path should reflect that. In my test this got the icon to appear in add remove programs
Also see Stefan's comment about the support files as that is a good way to deploy the file. In my case I am actually using a sub installer to deploy it since the installscript project is actually wrapping 2 other installers (ugly but functional)
Posted 24 March 2011 - 14:46
The problem I am running into is that I can not get something to consistently deploy /read where I expect it to. So if I set something in my install dir which is c:\ProgramFiles\MyCompany\MyProject
and I install on a 64bit machine I get the Program Files (x86) folder instead which is not a problem for my installation. However I have not found a way to make the path for the icon pick up like this. If I set my icon path to be c:\Programfiles\mycompany\myproject it will not look in the x86 version. I tried using the variable [INSTALLDIR] just like that but it didnt work. I also tried [COMMONFILES] which has the same problem.
Is there a way to use a variable there that will look in the proper location everytime?
Posted 25 March 2011 - 13:29

Posted 25 March 2011 - 14:19
[TARGETDIR]\myicon.ico which does not appear to work...
What am I doing wrong?
Edited by overlordchin, 25 March 2011 - 14:19.
Posted 25 March 2011 - 14:36
and <TARGETDIR>\MyIcon.ico
How am I supposed to refer to it properly to make it work?
The only way I have consistently been able to get it to work is to make an absolute path and then move the icon there.
Posted 28 March 2011 - 13:34
CODE |
TARGETDIR ^ "MyIcon.ico" |
If for some reason it's still not working, then please confirm the resulting registry entry and the availablility of the icon file.

Posted 28 March 2011 - 14:50
Sorry if I am being too literal in my interpretation of your post. Is there a way to do this in the add remove view area? Or does it need to be in the script? If so where do I change it(see above question)?
Thanks for all of your input so far. It is appreciated.
*** EDIT ***
I tried putting it in the
function onMoveData()
begin
IFX_PRODUCT_ICON = TARGETDIR ^ "myicon.ico";
end;
and now my installer no longer installs so that was apparently not an appropriate place to put it. NOTE: previously that method did not exist in my rul file so it was going with the default version of this method.
*** 2nd EDIT ***
onBegin() also does not work but does not break the installer like changing onMoveData() does.
*** 3rd EDIT ***
I did also try the same string you suggested in the add / remove programs view under the display icon setting. It did not seem to have any impact on the installer.
I did a search for my icon name and found where it sets display icon in the registry:
the path looks like:
"[ProgramFilesFolder]MyCompany\MyProduct\MyIcon.ico" only with out the ""
It is actually possible that registry key is created by one of the wrapped installers. This script wraps 2 installers into one bundle. The 2nd product is actually hidden from the add/remove programs list and the bundle installer is actually placed there instead. So when you remove the bundle you remove all associated software. Just to complicate matters further: The bundle and the sub product both have the same name and the same icon.
Edited by overlordchin, 28 March 2011 - 15:48.
Posted 29 March 2011 - 14:05
To that end, add the following code to the "After Move Data" | "OnFirstUIAfter" method as that event is triggered after the file transfer for the initial installation:
CODE |
function OnFirstUIAfter() NUMBER nResult, nvType; STRING szARPKey, szARPIcon; begin RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); szARPKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + PRODUCT_GUID; nvType = REGDB_STRING; szARPIcon = TARGETDIR ^ "myicon.ico"; nResult = RegDBSetKeyValueEx(szARPKey, "DisplayIcon", nvType, szARPIcon, -1); end |
Hopefully that clarifies things, but let me know if you have any additional questions/problems.

Posted 30 March 2011 - 14:20
This installer normally calls two other installer projects. Only one actually installs even though both entries show up in the add/remove programs. The icon still does not appear although this time there is a reason. The code causes the 2nd installer to not install for whatever reason and since it does not install there is no folder containing the icon.
I cut and paste your code minus the declaration of the function and begin / end to my OnFirstUiAfter() method.
I do not see anything harmful in your code when I look at it so I am sort of puzzled that it breaks stuff. The only thing I can think of is that nResult is already used but it should not matter. The value gets reset about 5 lines after your stuff when nResult is set = to something else.
Thoughts?
Posted 30 March 2011 - 23:40

Posted 11 April 2011 - 16:10
Posted 12 April 2011 - 13:26

Posted 03 June 2011 - 20:30
CODE |
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); szARPKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + GUIDHERE; nvType = REGDB_STRING; szParameter = "ProgramFiles(x86)"; svValue = GetEnvVar (szParameter,szEnvPath); szARPIcon = szEnvPath ^ "\\My Company\\MyProduct\\MyIcon.ico"; nResult = RegDBSetKeyValueEx(szARPKey, "DisplayIcon", nvType, szARPIcon, -1); // end icon code |
thankyou so much for your help with this. It is greatly appreciated
Posted 09 June 2011 - 16:36
Posted 10 June 2011 - 20:20