1

インストールするファイルが多数あるインストーラーがあります。すべてのファイルを収集するために heat.exe を使用しています。この heat コマンドは実際にはビルド スクリプトの一部であり、その後に Candle.exe や light.exe などの他のコマンドが続きます。これで、アプリケーションの test.exe も自動生成された GUID とコンポーネント ID と共に収集されます。この特定のアプリケーションをファイアウォールの例外として追加するにはどうすればよいですか? 問題は、スクリプトを使用してインストーラーをビルドするたびに、新しいハーベスト ファイルが新しいコンポーネント ID で生成されることです。助言がありますか?

4

1 に答える 1

1

heatXSL 変換引数を受け入れて、必要な方法で出力を変更します。単純な XSL スタイルシートは、FileXPath を介して選択された特定の要素に要素を追加できます。

test.exeこれは、実行中にのみ存在することを前提としていますheatmatchそうでない場合は、属性の XPath を変更します。

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:wix='http://schemas.microsoft.com/wix/2006/wi'
    xmlns:fire='http://schemas.microsoft.com/wix/FirewallExtension'
    xmlns='http://schemas.microsoft.com/wix/2006/wi'
    exclude-result-prefixes='wix'
    >
  <xsl:output method="xml" indent="yes" />

  <xsl:template match="//wix:File[contains(@Source,'\test.exe')]">
    <wix:File>
      <xsl:copy-of select="@*" />
      <fire:FirewallException Id='test.exe' Name='Test Server' IgnoreFailure='yes'>
        <xsl:comment> localhost won't work here </xsl:comment>
        <fire:RemoteAddress>127.0.0.1</fire:RemoteAddress>
      </fire:FirewallException>
      <xsl:apply-templates select="node()" />
    </wix:File>
  </xsl:template>

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

  <xsl:template match="/">
    <xsl:comment>!!!DO NOT EDIT!!! Generated by heat.exe and FirewallExceptions added.</xsl:comment>
      <xsl:apply-templates />
  </xsl:template>

</xsl:stylesheet> 
于 2013-07-07T15:48:11.987 に答える