首页 > 解决方案 > WiX排除特定文件夹下的某些文件或某些文件类型?

问题描述

我已经使用“HeatDirectory”来收集所有文件。但我需要删除“bin”文件夹下的所有(*.xml 和 *.pdb)文件。

我可以删除具有任何扩展名的单个文件。但是,如何删除特定文件夹下的某些文件或某些文件类型?

下面是我用来根据扩展名删除文件的 XSLT。

<?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">
<xsl:template match="@*|*">
    <xsl:copy>
        <xsl:apply-templates select="@*" />
        <xsl:apply-templates select="*" />
    </xsl:copy>
</xsl:template>

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

<xsl:key name="RemoveGlobal.asax.cs" 
match="wix:Component[contains(wix:File/@Source, 'Global.asax.cs')]" use="@Id" 
/>
<xsl:key name="RemoveCsproj" match="wix:Component[contains(wix:File/@Source, 
'.csproj')]" use="@Id" />

<xsl:template match="*[self::wix:Component or self::wix:ComponentRef] 
[key('RemoveGlobal.asax.cs', @Id)]" />  
<xsl:template match="*[self::wix:Component or self::wix:ComponentRef] 
[key('RemoveCsproj', @Id)]" />  
</xsl:stylesheet>

标签: wixwix3

解决方案


推荐阅读