Question

I'm just starting out with WiX 3 and can't figure out why it can't understand the Icon attributes in my .wsx file. I get the error message:

Error 2 Unresolved reference to symbol 'Icon:Sample.exe' in section 'Product:{95DB18C7-24DC-474D-B58C-DC91AFD912F3}'.

The section it is complaining about is:

<Shortcut Id="startmenuSample" Directory="ProgramMenuFolder" Name="Sample 1.0"
 WorkingDirectory='INSTALLDIR' Icon="Sample.exe" IconIndex="0" Advertise="yes" />

If I comment that section out, the installer works fine.

Was it helpful?

Solution

The error message is trying to tell you that the Shortcut/@Icon attribute is referencing an Icon element with Id attribute = "Sample.exe". However, the Icon element does not exist. There should have been a line number in there to help you find the reference.

Anyway, you need something like

<Icon Id="Sample.exe" SourceFile="your.ico"/>

OTHER TIPS

If you mark the shortcut as "Advertise=yes", then the icon is not available yet because your app is not yet installed, only advertised.

You have to include the icon directly in the msi, not in the advertised exe. Or set "Advertise=no".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top