Wix:如何将“C:\Windows\hh.exe"作为我的 CHM 文件快捷方式的图标源? [英] Wix: How can I point `C:\Windows\hh.exe` as the source of the icon for my CHM-file shortcut?

查看:28
本文介绍了Wix:如何将“C:\Windows\hh.exe"作为我的 CHM 文件快捷方式的图标源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建我的 CHM 文件的快捷方式.它的图标将从 C:\Windows\hh.exe 文件中获取.Icon 属性需要组件的 Id,但 hh.exe 在我的 MSI 中不存在,因为它始终存在于 C:\Windows\ 目录.因此它不起作用:

I need to create the shortcut to my CHM-file. Its icon are to be gotten from the C:\Windows\hh.exe file. The Icon attribute requires an Id of component, but hh.exe is absent in my MSI because it always exists in the C:\Windows\ directory. Therefore it will not work:

<Component Id="Help_default" Guid="{BE58A822-637E-4B58-B2AC-690BA9FDF833}">
  <File Name="ProxyTools.chm" KeyPath="yes">
    <Shortcut Id="ProxyTools.exe" Directory="ProgramMenuDir" 
              Name="ProxyTools (English)" 
              WorkingDirectory='INSTALLDIR' Advertise="yes" Icon="hh.exe" IconIndex="0"/>
  </File>
</Component>

也许我想以某种方式指向 hh.exe 之类的

Maybe I am to point somehow the hh.exe like the item of

<Directory Id="WindowsFolder"/>

如何将 C:\Windows\hh.exe 指向我的 CHM 文件快捷方式的图标源?

How can I point C:\Windows\hh.exe as the source of the icon for my CHM-file shortcut?

UPD

我将 hh.exe 添加到我的 WiX 项目中并添加了这个:

I added hh.exe into my WiX project and added this:

<Icon Id="hh.exe" SourceFile="hh.exe"/>

现在快捷方式是正确的.

Now shortcuts is right.

推荐答案

Windows Installer 无法做到这一点.要了解确切的功能集,您必须检查基础表.首先快捷表图标列是外部键到 图标表 的第一列."Icon 表包含一个主键(由快捷表等引用)和一个二进制条目.二进制数据是要使用的图标数据.

Windows Installer does not make this possible. To understand the exact capability set, you must examine the underlying tables. First the Shortcut table Icon column is "The external key to column one of the Icon table." The Icon table contains a primary key (referred to by the shortcut table, among others) and a binary entry. The binary data is the icon data to use.

由于实际图标数据必须存储在生成的 .msi 数据库中,并且没有其他方法可以指定图标,因此您不能引用系统中可能已存在的图标.您可以将所需的图标复制到 Icon 表的资源中,但这与您可以使用本机 Windows Installer 功能尽可能接近.

Since the actual icon data must be stored in the resulting .msi database, and there are no alternate ways to specify an icon, you cannot refer to an icon that may already exist on the system. You can copy the desired icon into a resource of the Icon table, but that's as close as you can come with native Windows Installer functionality.

这篇关于Wix:如何将“C:\Windows\hh.exe"作为我的 CHM 文件快捷方式的图标源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆