用热收割文件夹时忽略文件夹

问题描述 投票:0回答:0

我正在尝试运行 heat.exe 来收集文件夹。该文件夹包含 3 个子文件夹,但我想忽略其中一个“config”。我按照此答案中的说明尝试了以下操作如何从热采集 (WiX) 中排除 SVN 文件?:

<xsl:stylesheet version="1.0"
                xmlns="http://schemas.microsoft.com/wix/2006/wi"
                xmlns:wi="http://schemas.microsoft.com/wix/2006/wi"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                exclude-result-prefixes="msxsl wi">

    <xsl:output method="xml" indent="yes"/>

    
    <!-- default copy all -->
    <xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

    <!-- Search directories for the components that will be removed. -->
    <xsl:key name="config-search" match="wi:Directory[@Name = 'config']" use="descendant::wi:Component/@Id" />
    <!-- Remove directories. -->
    <xsl:template match="wi:Directory[@Name='config']" />
    <!-- Remove componentsrefs referencing components in those directories. -->
    <xsl:template match="wi:ComponentRef[key('config-search', @Id)]" />
    
  <!-- Get the right sourceDir for the files -->
  <xsl:template match="wi:File/@Source">
    <xsl:attribute name="{name()}">
        <xsl:variable name="sourceDirStart" select="substring-before(., '\')"/>
        <xsl:variable name="sourceDirEnd" select="substring-after(., '\')" />
        <xsl:value-of select="concat($sourceDirStart, '\', $sourceDirEnd)" />
    </xsl:attribute>
  </xsl:template>  

</xsl:stylesheet>

但这行不通。有人可以在这里指出我的错误吗?

xslt wix heat harvest
© www.soinside.com 2019 - 2024. All rights reserved.