我有很多文件需要在wix的每个用户安装项目中进行收集。
我使用heat.exe来收集文件,但是每个组件中的每个文件都有自己的关键路径属性,而我的文件将复制到“应用程序数据”中,因此必须使用HKCU下的注册表键作为其KeyPath,所以我必须更改XML文件中的每个项。
是否可以通过heat.exe完成?我有数千个文件要收集,手动修复太可怕了。
我有很多文件需要在wix的每个用户安装项目中进行收集。
我使用heat.exe来收集文件,但是每个组件中的每个文件都有自己的关键路径属性,而我的文件将复制到“应用程序数据”中,因此必须使用HKCU下的注册表键作为其KeyPath,所以我必须更改XML文件中的每个项。
是否可以通过heat.exe完成?我有数千个文件要收集,手动修复太可怕了。
xslt
来定制具有子节点的节点的 KeyPath
项。<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="msxsl"
xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
xmlns:my="my:my">
<xsl:output method="xml" indent="yes" />
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match='wix:Wix/wix:Fragment/wix:ComponentGroup/wix:Component'>
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:attribute name="KeyPath">
<xsl:text>no</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
这篇文章参考了@KirillPolishchuk的答案 https://dev59.com/j2sz5IYBdhLWcg3wOlSh#8035049