1

I'm creating a WIX setup for a Web Application. I used the setup to wix add-in to do this very fast. But how do I exclude the web.config out of the directory?

I don't want a filter on all the .config files, just a filter on the web.config. Thanks.

I created a test project called WebApplicationWix.

4

1 回答 1

2

只需在转换中的过滤器中更具体。请记住,过滤器是在 SRC 值上完成的。

例如 wix:Component[contains(wix:File/@Source, ' *.config ')] 到 wix:Component[contains(wix:File/@Source, ' $(var.HostFileDir)\Web.config ')]

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

  <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" />
  <xsl:strip-space elements="*" />

  <!-- Get harvest file details -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>

  <!-- Match and ignore Web.Config file-->
 <xsl:key name="config-search" match="wix:Component[contains(wix:File/@Source, '$(var.HostFileDir)\Web.config')]" use="@Id" />
  <xsl:template match="wix:Component[key('config-search', @Id)]" />
  <xsl:template match="wix:ComponentRef[key('config-search', @Id)]" />

</xsl:stylesheet>
于 2015-04-13T08:17:03.747 回答