Those properties won't be evaluated at runtime. Instead, they'll be set to
the specified text. The expression in the Condition element will then be
evaluated as

"VersionNT = 501 AND ServicePackLevel >=2" OR "VersionNT = 502 AND
ServicePackLevel >=1" OR "VersionNT > 502"

The condition evaluation treats any non-empty string as being TRUE, so the
condition evaluates to TRUE and the install proceeds.

You'll either have to specify the condition completely within the Condition
element, or you need to use Custom Action Type 51, which enables you to set
a property to the _evaluated_ result of an expression. They look like this:

<CustomAction Id="TestWin2kSP4" Property="WIN2KSP4EXISTS" 
   Value="[VersionNT] = 500 AND [ServicePackLevel] >= 4"/>

(I may have the brackets placed wrong, I've not tested this.)

You should be able to schedule these before the LaunchConditions action.

-- 
Mike Dimmick

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nick
Sent: 14 March 2007 20:01
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Install only on XP SP2 or better

I'm trying to make some code that installs only on Windows:

XP SP2 or better,
2003 SP1 or better,
or Vista or better.

I'm using the code below, and my application happily installs itself on
Win2000.
 What am I doing wrong?



    <Property Id="WIN2KSP4EXISTS"><![CDATA[VersionNT = 500 AND
ServicePackLevel
>=4]]></Property>
    <Property Id="WINXPSP2EXISTS"><![CDATA[VersionNT = 501 AND
ServicePackLevel
>=2]]></Property>
    <Property Id="WIN2K3SP1EXISTS"><![CDATA[VersionNT = 502 AND
ServicePackLevel
>=1]]></Property>
    <Property Id="WINVISTAORBETTEREXISTS"><![CDATA[VersionNT >
502]]></Property>
    <Condition Message="This setup requires Windows XP with Service Pack
2."><![CDATA[WINXPSP2EXISTS OR WIN2K3SP1EXISTS OR
WINVISTAORBETTEREXISTS]]></Condition>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to