Wix - 运行 基于 windows 版本条件的自定义操作

Wix - Run custom action based on windows version condition

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

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

最好的方法是什么? 谢谢

我找到了解决方案。为了防止基于操作系统条件的安装,我使用了:

<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”是相对于 OS 版本 (501 = Windows XP) 时。

谢谢你。