wix
  • windows-installer
  • 2016-08-03 89 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> 
    
    相关问题