Wix 无法解析符号“Icon”

发布于 2024-07-30 08:10:03 字数 393 浏览 1 评论 0原文

我刚刚开始使用 WiX 3,不明白为什么它无法理解我的 .wsx 文件中的图标属性。 我收到错误消息:

错误 2 “产品:{95DB18C7-24DC-474D-B58C-DC91AFD912F3}”部分中对符号“Icon:Sample.exe”的引用未解析。

它抱怨的部分是:

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

如果我注释掉该部分,安装程序就可以正常工作。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

素衣风尘叹 2024-08-06 08:10:03

该错误消息试图告诉您 Shortcut/@Icon 属性正在引用 Id 属性 =“Sample.exe”的 Icon 元素。 但是,图标元素不存在。 那里应该有一个行号来帮助您找到参考。

无论如何,您需要类似

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

伪心 2024-08-06 08:10:03

如果您将快捷方式标记为“Advertise=yes”,则该图标尚不可用,因为您的应用程序尚未安装,仅进行了广告。

您必须将图标直接包含在 msi 中,而不是包含在广告的 exe 中。 或者设置“广告=否”。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文