8

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!

BartoszKP
  • 34,786
  • 15
  • 102
  • 130
Facy87
  • 145
  • 1
  • 2
  • 11

1 Answers1

12

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>
user145400
  • 1,076
  • 1
  • 12
  • 27
  • 2
    Thx! But how can I check the windows version like this? Custom Action="CreateRegistryEntries" After="CostInitialize"> <![CDATA[VersionNT >= 600]]> ? – Facy87 Feb 09 '15 at 17:07
  • I think you can just do it without the CDATA tags – user145400 Feb 09 '15 at 17:12