wix
  • windows-installer
  • 2016-08-03 127 views 0 likes 
    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> 
    
    相關問題