argoth
argoth

Reputation: 1253

Wix - Run custom action based on windows version condition

I'm trying to create a custom action that runs on specific windows versions. It works ?

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

What is the best way to do this ? Thanks.

Upvotes: 0

Views: 737

Answers (1)

argoth
argoth

Reputation: 1253

I found the solution. To prevent installation based on operational system condition i used:

<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>

When "501" is relative to OS Version (501 = Windows XP).

ThankU.

Upvotes: 1

Related Questions