Fac*_*y87 6 conditional windows-installer custom-action wix conditional-statements
我正在尝试根据Windows版本运行自定义操作(删除某个文件).我知道如何检查Windows版本:
<Condition Message="Windows version xxx required...">
<![CDATA[Installed OR (VersionNT >= 600)]]>
</Condition>
Run Code Online (Sandbox Code Playgroud)
但是,我不想显示消息,而是删除文件.我找不到一个如何使用这样的条件运行oder不运行自定义操作的示例!
您需要在Custom元素中指定运行自定义操作的条件.(这允许您在序列中的不同位置多次运行自定义操作,并且每次根据需要使用不同的条件).
例:
<InstallExecuteSequence>
<Custom Action="CreateRegistryEntries" After="CostInitialize">
NOT Installed AND NOT PATCH
</Custom>
</InstallExecuteSequence>
Run Code Online (Sandbox Code Playgroud)