Wix cannot resolve symbol "Icon"
Asked Answered
J

2

9

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.

Jotting answered 5/8, 2009 at 2:52 Comment(0)
D
9

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"/>

Darren answered 5/8, 2009 at 16:45 Comment(4)
Hey Rob just realized your "the guy" for WiX. I'm having a harder-than-necessary time understanding WiX by pulling together various examples and asking questions. Is there a piece of solid documentation I'm missing?Jotting
Have you read the WiX.chm and WiX tutorial? Without an overview of the system it can very difficult to jump in the middle.Darren
Hey, thanks, that makes sense, thanks, but what if the icon is not a standalone file, but is in my executable?Dremadremann
I have just realised that for a non-advertised shortcut (which is a normal shortcut, advertised ones redirect via the Windows Installer mechanism every time you click on them) you can omit the shortcut's Icon attribute, it seems to default to the icon of the target file. Hooray.Dremadremann
I
1

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".

Incursive answered 5/8, 2009 at 5:49 Comment(3)
Just to let you guys know... I'm on vacation for 2 days and will try this out tomorrow.Jotting
... aaand, what was ur result ? ;)Maricruzmaridel
His vacation is sooo long... Lucky guy.Shulins

© 2022 - 2024 — McMap. All rights reserved.