3

Heat ツールを使用して、コンテンツをインストールするフォルダーに基づいて wxs ファイルを生成しました。これにより、次のような大きなファイルが得られます。

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef Id="TARGETDIR">
            <Directory Id="dir1FC8A0605F7DF8B33E3EECB0A1270FA2" Name="DirectoryName" />
        </DirectoryRef>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="ComponentGroupId">
            <Component Id="cmp1FB67A60B41F3170889B7E5739A23560" Directory="dir1FC8A0605F7DF8B33E3EECB0A1270FA2" Guid="{2DC3B790-D29C-4090-B4CF-5C27687C6ABE}">
                <File Id="filF1E1262E52254B1846C7CB2393126A6F" KeyPath="yes" Source="PathToFile" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

メインの Wix ファイル Product.wxs には、Heat によって作成された上記の ComponentGroup を参照する機能があります。機能は次のようになります。

<Feature Id="FeatureId" Title="FeatureTitle" Level="1" AllowAdvertise="no" Absent="disallow" Description="Feature description.">
    <ComponentGroupRef Id="ComponentGroupId" />
</Feature>

これは機能していますが、インストーラーを実行すると、コンポーネント グループ内のファイルが C ドライブのルート (つまり、C:\DirectoryName) に配置されますが、それらを Program Files (例: C:\Program Files\) に配置したいと考えています。ディレクトリ名)。

何か案は?

ありがとう、アラン

4

1 に答える 1

6

-dr次のような引数を使用して、参照するディレクトリのIDをheatに渡すことができます。

heat -dr AutogeneratedComponentsDir

または、msbuildでHeatDirectoryタスクを使用している場合は、DirectoryRefId属性。

次に、メインのProduct.wxsでそのディレクトリの場所を定義するだけです。

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="INSTALLDIR" Name="YourProduct">
      <Directory Id="AutogeneratedComponentsDir"/>
    </Directory>
  </Directory>
</Directory>
于 2011-06-28T21:35:21.520 に答える