2016-08-03 4 views
0

既存のアプリケーション用のアドオンモジュールをインストールするWiX 3.10インストーラがあります。このため、私はRegistrySearchを使ってアドオンを置くべきインストールフォルダを取得します。その後、同じディレクトリ内の既に存在する(これは基本アプリケーションの一部であり、アドオンではない)ユーティリティはいくつかのパラメータで実行されなければなりません。WiX - プロパティ内のプロパティを使用する

<Property Id="INSTALLFOLDER"> 
     <RegistrySearch Id='InstallPathRegistry' Type='raw' Root='HKLM' Key='SOFTWARE\Vendor\Application' Name='InstallPath' Win64='no'/> 
    </Property> 

    <Condition Message="Application installation folder not found."> 
     <![CDATA[Installed OR INSTALLFOLDER]]> 
    </Condition> 

    <Property Id="WixQuietExecCmdLine" Value="RegAddOn.exe /f [INSTALLFOLDER]\Addon.RegFile" /> 
    <CustomAction Id="QtExec" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="immediate" Return="check" /> 




<InstallExecuteSequence> 
    <Custom Action="QtExec" OnExit="success"/> 
</InstallExecuteSequence> 

残念ながら、[INSTALLFOLDER]が解決されていません。

は、私はこれを試してみました。明らかに、私もこのことについてコンパイラの警告を得る。

プロパティを解決するにはどうすればよいですか?

答えて

0

あなたの警告は何をすべきかを述べている:

Warning  The 'X1' Property contains '[X2]' in its value which is an illegal reference to another property. If this value is a string literal, not a property reference, please ignore this warning. To set a property with the value of another property, use a CustomAction with Property and Value attributes. 

注:プロパティと値の属性とのCustomActionを使用しています。

だから、あなたは全く価値

<Property Id="WixQuietExecCmdLine" Value=" " /> 

であなたのプロパティを定義し、それ

<CustomAction Id="SetProp" Property="WixQuietExecCmdLine" Value="RegAddOn.exe /f [INSTALLFOLDER]\Addon.RegFile"></CustomAction> 

を埋めるためにカスタムアクションを使用して、現在のカスタムアクションの前にそれを実行する必要があります

<InstallExecuteSequence> 
    <Custom Action="SetProp" OnExit="success"/> 
    <Custom Action="QtExec" After="SetProp"/> 
</InstallExecuteSequence> 
関連する問題