I am using Wix to create my installer. According to the official documentation, if I want to change the icon in Add/Remove Programs, I need to add this:
<Icon Id="icon.ico" SourceFile="MySourceFiles\icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
But it does not works, the icon is not changed and I also get the following warning:
C:\Users\rsheink\home\repos\tenlira\10Lira\TestWiXProject\Product.wxs(137,0): warning LGHT1076: ICE36: Icon Bloat. Icon icon.ico is not used in the Class, Shortcut, or ProgID table and also not used for ARPPRODUCTICON property.
What am I missing please?
Thanks. Refael.
Edit: Following the excelent advice from @harper, here is the MCVE:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:difx="http://schemas.microsoft.com/wix/DifxAppExtension">
<Product Id="*" Codepage="1252" Language="1033" Manufacturer="Intel Corporation"
Name="TenLira" UpgradeCode="PUT-GUID-HERE" Version="31.00.0000">
<Package Comments="Contact: Your local administrator" Description="TenLira" InstallerVersion="500"
Compressed="yes"
InstallScope="perMachine"
Keywords="Installer,MSI,Database" Languages="1033" Manufacturer="Intel Corporation" Platform="x64" />
<Media Id="1" Cabinet="my_application.cab" EmbedCab="yes" />
<MajorUpgrade AllowDowngrades="no"
AllowSameVersionUpgrades="no"
Disallow="no"
IgnoreRemoveFailure="no"
MigrateFeatures="yes"
Schedule="afterInstallInitialize"
DowngradeErrorMessage="A later version of [ProductName] is already installed" />
<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONROOTDIRECTORY" />
<UIRef Id="WixUI_InstallDir" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="PROGRAMFILESSUBDIR" Name="Intel Corporation">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="TenLira">
<Directory Id="kmgl" Name="kmgl">
<Directory Id="kmgl_win10" Name="kmgl_win10" />
</Directory>
<Directory Id="tools" Name="tools" />
</Directory>
</Directory>
</Directory>
</Directory>
<DirectoryRef Id="tools">
<Component Id="devcon.exe" Guid="*">
<File Id="devcon.exe" Source="..\tools\devcon\amd64\devcon.exe" KeyPath="yes" />
</Component>
</DirectoryRef>
<Feature Id="MainApplication" Title="TenLira" Level="1">
<ComponentRef Id="devcon.exe" />
</Feature>
<!--It should set the icon in Add/Remove programs, but it does not works and I don't know why.-->
<Icon Id="icon.ico" SourceFile="..\TenLira icons\coins\coins.ico" />
<Property Id="ARPPRODUCTION" Value="icon.ico" />
</Product>
</Wix>
Request: Please comment if any of the below works for you - and also if you did something else (as well) to get things working.
Quick List First:
- Is
ARPPRODUCTICON
spelled correctly?- Does the
File.ico
file have a hidden file extension? Example:icon.ico.bmp
- 1.
Show file extensions in Windows Explorer
- Open a
cmd.exe
in the folder and do a dir to check?- Icon file problems:
- Is that a proper *.ico file? Try to save a normal *.bmp and rename the extension to *.ico. That should work for a rudimentary test icon.
- Find a proper template *.ico file for testing (there should be plenty in your Visual Studio installation folder).
UPDATE:
Please try to change this:
<Property Id="ARPPRODUCTION" Value="icon.ico" />
into this:
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
I will leave the original answer below since the setup.exe issue might be relevant for others.
And one more thing: I was told that the dialog set <UIRef Id="WixUI_Mondo" />
is the better one in the available WiX templates. I have no hard facts apart from that recommendation though. I haven't used <UIRef Id="WixUI_InstallDir" />
- just if it can save you some time.
Old Answer:
This might just be a uppercase / lowercase issue. As in icon.ico
instead of Icon.ico
.
Correct:
<Icon Id="Icon.ico" SourceFile="MySourceFiles\Icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="Icon.ico" />
Wrong:
<Icon Id="icon.ico" SourceFile="MySourceFiles\icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="Icon.ico" />
During my testing I get the warning though, but the icon does work in Add/Remove Programs either way. Are you making a setup.exe bundle?
When you make a setup.exe bootstrapper bundle, you have to set the IconSourceFile
attribute of the Bundle Element.
A link for safekeeping: How to customize icon for Wix custom bootstrapper.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With