在不同片段中添加 WiX 文件的快捷方式

发布于 2024-08-26 21:29:31 字数 1066 浏览 4 评论 0原文

我使用 heat.exe 生成与此类似的片段:

<Fragment>
  <DirectoryRef Id="INSTALLDIR">
    <Component Id="id1" Guid="*">
      <File Id="fid1" KeyPath="yes" Source="SourceDir\Foo1.dll" />
    </Component>
    <Component Id="id2" Guid="*">
      <File Id="fid2" KeyPath="yes" Source="SourceDir\Foo2.dll" />
    </Component>
    <Component Id="id3" Guid="*">
      <File Id="fid3" KeyPath="yes" Source="SourceDir\Bar.exe" />
    </Component>
  </DirectoryRef>
</Fragment>

<Fragment>
    <ComponentGroup Id="Components">
        <ComponentRef Id="id1" />
        <ComponentRef Id="id2" />
        <ComponentRef Id="id3" />
    </ComponentGroup>
</Fragment>

这些片段存储在自动生成的 wxs 文件中。

然后我将它们添加到我的功能中(在主 WiX 文件中),如下所示:

<ComponentGroupRef Id="Components"/>

这工作正常。

不过,我还想将 Bar.exe 的快捷方式添加到我的开始菜单中。 理想情况下,我希望在主 wix 文件中执行此操作,而 Bar.exe 组件仍驻留在自动生成的 wxs 文件中。 在不修改自动生成的代码的情况下如何解决这个问题?

I'm using heat.exe to generate fragments similar to this:

<Fragment>
  <DirectoryRef Id="INSTALLDIR">
    <Component Id="id1" Guid="*">
      <File Id="fid1" KeyPath="yes" Source="SourceDir\Foo1.dll" />
    </Component>
    <Component Id="id2" Guid="*">
      <File Id="fid2" KeyPath="yes" Source="SourceDir\Foo2.dll" />
    </Component>
    <Component Id="id3" Guid="*">
      <File Id="fid3" KeyPath="yes" Source="SourceDir\Bar.exe" />
    </Component>
  </DirectoryRef>
</Fragment>

<Fragment>
    <ComponentGroup Id="Components">
        <ComponentRef Id="id1" />
        <ComponentRef Id="id2" />
        <ComponentRef Id="id3" />
    </ComponentGroup>
</Fragment>

These fragments are stored in the auto-generated wxs file.

I'm then adding them into my feature (in the main WiX file) like so:

<ComponentGroupRef Id="Components"/>

This works fine.

However, I'd also like to add a shortcut to Bar.exe to my start menu.
I ideally want to do this in my main wix file, with the Bar.exe component still residing in the auto-generated wxs file.
How would I approach this problem without modifying the auto-generated code?

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

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

发布评论

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

评论(1

短叹 2024-09-02 21:29:31

您一定希望它驻留在定义中吗?您可以将其放在单独的组件中,就像手册中演示的那样: http: //wix.sourceforge.net/manual-wix3/create_start_menu_shortcut.htm

否则,您可能应该通过在其中添加定义来使用 XSL 转换来转换热量输出。 Heat.exe 接受在收获后立即应用 XSL 转换的开关。

希望这有帮助。

Do you necessarily want it to reside in the definition? You can have it in a separate component, the way it is demonstrated in the manual: http://wix.sourceforge.net/manual-wix3/create_start_menu_shortcut.htm

Otherwise, you should probably transform the heat output with the XSL transform by adding the definition there. Heat.exe accepts the switch to apply XSL transform right after harvesting.

Hope this helps.

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