Wix - 根据Windows版本条件运行自定义操作

时间:2015-12-11 11:56:16

标签: wix window installer

我正在尝试创建在特定Windows版本上运行的自定义操作。它有效吗?

Custom Action="DoSomething" After="CostInitialize"> 
<![CDATA[VersionNT >= 600]]> 
</Custom>

最好的方法是什么? 感谢。

1 个答案:

答案 0 :(得分:1)

我找到了解决方案。为了防止根据我使用的操作系统条件进行安装:

<CustomAction Id="DoSomething" BinaryKey="CustomAction.CA.dll" DllEntry="DoSomething" Execute="immediate" Return="check" />

 <InstallExecuteSequence>
    Custom Action="DoSomething" After="CostInitialize"> 
    <![CDATA[NOT(VersionNT = 501)]]>
    </Custom>
 </InstallExecuteSequence>

当“501”相对于操作系统版本(501 = Windows XP)时。

ThankU。