我正在使用Heat工具生成Wix标记,以在我的安装程序中包含大量文件和文件夹。这一切都运行良好,但我刚刚意识到,自从我将源文件夹添加到我的Subversion存储库中,Heat也想包含.svn文件夹。
有没有办法告诉Heat不要收集与给定标准匹配的文件或文件夹?
我目前正在使用Wix 3.5。
以下是我使用的方法:
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
<!-- Copy all attributes and elements to the output. -->
<xsl:template match="@*|*">
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates select="*" />
</xsl:copy>
</xsl:template>
<xsl:output method="xml" indent="yes" />
<!-- Create searches for the directories to remove. -->
<xsl:key name="svn-search" match="wix:Directory[@Name = '.svn']" use="@Id" />
<xsl:key name="tmp-search" match="wix:Directory[@Name = 'tmp']" use="@Id" />
<xsl:key name="prop-base-search" match="wix:Directory[@Name = 'prop-base']" use="@Id" />
<xsl:key name="text-base-search" match="wix:Directory[@Name = 'text-base']" use="@Id" />
<xsl:key name="props-search" match="wix:Directory[@Name = 'props']" use="@Id" />
<!-- Remove directories. -->
<xsl:template match="wix:Directory[@Name='.svn']" />
<xsl:template match="wix:Directory[@Name='props']" />
<xsl:template match="wix:Directory[@Name='tmp']" />
<xsl:template match="wix:Directory[@Name='prop-base']" />
<xsl:template match="wix:Directory[@Name='text-base']" />
<!-- Remove Components referencing those directories. -->
<xsl:template match="wix:Component[key('svn-search', @Directory)]" />
<xsl:template match="wix:Component[key('props-search', @Directory)]" />
<xsl:template match="wix:Component[key('tmp-search', @Directory)]" />
<xsl:template match="wix:Component[key('prop-base-search', @Directory)]" />
<xsl:template match="wix:Component[key('text-base-search', @Directory)]" />
<!-- Remove DirectoryRefs (and their parent Fragments) referencing those directories. -->
<xsl:template match="wix:Fragment[wix:DirectoryRef[key('svn-search', @Id)]]" />
<xsl:template match="wix:Fragment[wix:DirectoryRef[key('props-search', @Id)]]" />
<xsl:template match="wix:Fragment[wix:DirectoryRef[key('tmp-search', @Id)]]" />
<xsl:template match="wix:Fragment[wix:DirectoryRef[key('prop-base-search', @Id)]]" />
<xsl:template match="wix:Fragment[wix:DirectoryRef[key('text-base-search', @Id)]]" />
</xsl:stylesheet>
不幸的是,今天你必须使用XSL转换来过滤掉“噪音”。这是一个针对Heat的功能请求。
heat -t
并提供一个XSL样式表来剥离.svn
下的任何内容。 - anton.burger