私はWix Installerについて学習しており、msiはインストーラを複数回実行するという要件があります。Wix、InstanceIDに基づいてインストールディレクトリを動的に変更する方法
私の質問は、WWTagNet.ServiceからInstallTirをWWTagNet.Service1、WWTagNet.Service2、WWTagNet.Service3に変更するには、コマンドラインでInstallDirをmsiexecに指定しないでください。
私はInstanceTransforms要素を使用し、3つのインスタンスを定義し、MultiInstance = "yes"というコンポーネントを追加しました。
私はINSTALLFOLDERとして指定されたディレクトリがInstanceIDに基づいて自動的に変更されると思いました。
msiexecのコマンドラインとして指定する代わりに、InstanceIDをINSTALLFOLDERに追加するだけです。
私は以下を使用しようとしましたが、動作していません。
<SetProperty Id="INSTALLFOLDER" After="LaunchConditions" Sequence="first" Value="[TARGETDIR][ProgramFilesFolder][Company][INSTANCEID]"><![CDATA[NOT Installed]]></SetProperty>
これらは、私のproduct.wxsファイルの関連部分です。
<Property Id="INSTANCEID" Value="0" />
<InstanceTransforms Property="INSTANCEID">
<Instance Id="I01" ProductCode="a4d890ed-e624-438e-8fd9-938cd7aa06be" ProductName="Service1" />
<Instance Id="I02" ProductCode="17c81aa7-0524-44f7-a2ea-3a618c9ceb6b" ProductName="Service2" />
<Instance Id="I03" ProductCode="8d858d7c-f66c-4ccb-9427-77b5c426c3e1" ProductName="Service3" />
</InstanceTransforms>
<Feature Id="ProductFeature" Title="WWTagNet.Service" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="Modules" />
</Feature>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="COMPANYFOLDER" Name="W W Wood Products Inc">
<Directory Id="INSTALLFOLDER" Name="WWTagNet.Service">
<Directory Id="MODULESFOLDER" Name="Modules" />
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="Modules" Directory="MODULESFOLDER">
<!--Install some files-->
</ComponentGroup>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!--Install some files-->
</ComponentGroup>
</Fragment>