HeatDirectory 仅收获根级文件

发布于 2025-01-17 19:15:47 字数 142 浏览 3 评论 0原文

有没有一种方法可以指导我的Wixproj中的热门任务仅在根级收获文件而不潜入任何子目录中?可以肯定的是,我可以在输出文件上运行XSL变换,但是我更喜欢一种更干净的方式。如果没有办法,那么如果有人有一个干净的XSL变换片段来处理它的简洁示例(至少可以节省时间)。多谢 :)

Is there a way to direct HeatDirectory task in my wixproj to harvest only files at the root level and not to dive into any sub-directories? For sure I can handle it running XSL transform on the output file, but I would prefer a cleaner way. If there is no way then I'd appreciate if anyone has a clean example of XSL transform snippet to handle it (will save me time at least). Thanks a lot :)

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

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

发布评论

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

评论(2

北恋 2025-01-24 19:15:47

XSLT似乎是最合适的方法。这里提到了其他几个解决方案:如何在Wix Toolset中排除文件,例如制作文件副本以收获或使用外部OpenSource应用程序。

此外,Wix还具有商业扩展包,并具有更强大的heat.exe替换,可以排除文件和文件夹,使用掩码: https://www.firegiant.com/wix/wep-documentation/harvesting/harvestfolder/

XSLT seems to be the most suitable way. A couple of other solutions are mentioned here: How to exclude files in Wix toolset, like making a copy of files to harvest or using external opensource app.

Also Wix has commercial expansion pack with more powerful replacement of heat.exe, which can exclude files and folder, use masks: https://www.firegiant.com/wix/wep-documentation/harvesting/harvestfolder/

狠疯拽 2025-01-24 19:15:47

由于看起来没有集成的方法可以通过 HeatDirectory 任务输入参数来处理它,因此我将发布我编写的 XSLT 片段,该片段对我有用。无论谁使用它都需要根据需要进行相应修改:

<xsl:key name="SubDirComponentKeys" match="/wix:Wix/wix:Fragment/wix:DirectoryRef/wix:Directory/wix:Directory//wix:Component" use="@Id" />
<xsl:template match="/wix:Wix/wix:Fragment/wix:DirectoryRef/wix:Directory/wix:Directory" />
<xsl:template match="//wix:ComponentRef[contains(key('SubDirComponentKeys',@Id)/wix:File/@Source, '\')]" />

Since it looks like there is no integrated way to handle it through the HeatDirectory task input parameters, then I will post the XSLT snipped I wrote which does that work for me. Whoever uses it needs to modify as per need accordingly:

<xsl:key name="SubDirComponentKeys" match="/wix:Wix/wix:Fragment/wix:DirectoryRef/wix:Directory/wix:Directory//wix:Component" use="@Id" />
<xsl:template match="/wix:Wix/wix:Fragment/wix:DirectoryRef/wix:Directory/wix:Directory" />
<xsl:template match="//wix:ComponentRef[contains(key('SubDirComponentKeys',@Id)/wix:File/@Source, '\')]" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文