cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
LKM_N4EN
Level 6

Install Condition - Detect Windows Service Pack

In Project Assistant view, I have choose that the application only could be installed on specific operating systems: Windows Vista, Windows XP and Windows 2000.

How could I add checking that the application could only be installed on Windows 2000 SP4 and Windows XP SP2 and above?? I mean even if I add the system search and use the property in "Install Condition", how should I modify the conditional statement?

Currently the condition is:

(Not Version9X) And (Not VersionNT=400) And (Not VersionNT=502) And (Not (VersionNT=600 And Not (MsiNTProductType=1)))
Labels (1)
0 Kudos
(7) Replies
Holger_G
Level 10

Take a look at the 'Operating System Property Values' in the MSI SDK.
To check for a service pack you can make use of the ServicePackLevel property.
0 Kudos
DLee65
Level 13

Check out the ServicePackLevel Windows Installer property.

EDIT: DOH, I did not read Holger G's post carefully enough ...:o
0 Kudos
LKM_N4EN
Level 6

So I would just simply add the following to above condition?

And (Not  (VersionNT=500 AND ServicePackLevel < 4)) And (Not  (VersionNT=501 AND ServicePackLevel < 2))
0 Kudos
DLee65
Level 13

Yes, that will work.
0 Kudos
lam1278
Level 6

DLee65 wrote:
Yes, that will work.



I tried the changes you suggested for including the ServicePackLevel property in my Install Condition, and it works great for XP SP2 (32-bit), but I can't seem to get it to work for XP SP2 (64-bit)... I am about ready to throw out the SP2 requirement and say it works on all flavors of XP because this is getting annoying.

Our product will work on XP SP2 (32-bit and 64-bit) and Vista (32-bit and 64-bit) and this is my install condition:


((Not Version9X=400) And (Not Version9X=410) And (Not Version9X=490) And (Not VersionNT=400) And (Not VersionNT=500) And (Not VersionNT=502)) AND (Not  (VersionNT=501 AND ServicePackLevel < 2))


Any suggestions??

Thanks,
Lynn
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Windows XP 64-bit looks a lot like Windows 2003 64-bit in that it's got VersionNT and VersionNT64 at 502. However MsiNTProductType differs between the two.

Personally I'd lean towards rewriting the condition more positively. Something like the following (assumes you want to allow Windows 2003 without SPs; note that the positive VersionNT checks implicitly block Windows 9x):

VersionNT >= 600 OR (VersionNT = 502 AND (MsiNTProductType > 1 OR ServicePackLevel >= 2)) OR (VersionNT = 501 AND ServicePackLevel >= 2) OR (VersionNT = 500 AND ServicePackLevel >= 4)
0 Kudos
lam1278
Level 6

Thanks Michael,

I actually ended up re-writing it more positively... after I posted, I figured I should use the MSI logging to figure out why Windows XP 64-bit was not flagging for me on the 501.... when I found out exactly what you did about the VersionNT = 502 property being similar to Windows 2003..

So I took the MsiNTProductType and said that we didn't run on anything that wasn't a client, but I didn't want to flag on future versions of Windows

(VersionNT=501 And ServicePackLevel>=2) Or (VersionNT>=502 AND MsiNTProductType == 1)

I'm not too concerned about people not running XP 64-bit SP2. But I appreciate the help you supplied in your install condition, and I may end up re-writing it using your example.

Thanks again,
Lynn
0 Kudos