How to run custom action based on condition?

2019-02-17 10:40发布

I'm trying to run a custom action (delete a certain file) based on the windows version. I know how to check for the windows version:

<Condition Message="Windows version xxx required...">
    <![CDATA[Installed OR (VersionNT >= 600)]]>
</Condition>

However, I do not want to display a message, but delete a file. I can't find an example on how to use such a condition to run oder not to run a custom action!

1条回答
Juvenile、少年°
2楼-- · 2019-02-17 11:21

You need to specify the condition inside the Custom element which runs your custom action. (This allows you to run the custom action multiple times in different locations in your sequence and with different conditions each time if desired).

Example:

<InstallExecuteSequence>
  <Custom Action="CreateRegistryEntries" After="CostInitialize">
    NOT Installed AND NOT PATCH
  </Custom>
</InstallExecuteSequence>
查看更多
登录 后发表回答