cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rguggisberg
Level 13

Windows 7 - MIN_Win7_Server2008R2_SQLVERSION

1st of 3 code snippets below works. Second 2 do not.
// The following code works:
if (SYSINFO.WINNT.bWinVista=TRUE) then
szSQLVersion = MIN_Vista_SQLVERSION;
endif;
//below does not work
if (SYSINFO.WINNT.bWin7_Server2008R2=TRUE) then
MessageBox("1. 2008 or Win7",SEVERE);
szSQLVersion = MIN_Win7_Server2008R2_SQLVERSION;
endif;
//below does not work either
if (SYSINFO.nISOSL=ISOSL_WIN7_SERVER2008R2) then
MessageBox("2. 2008 or Win7",SEVERE);
szSQLVersion = MIN_Win7_Server2008R2_SQLVERSION;
endif;
Any ideas?
Thanks,
Ron
Labels (1)
0 Kudos
(4) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

If you are running this from a custom action in an MSI package, Windows shims msiexec.exe with a GetVersion/Ex lie to indicate the process is running on a Vista/2008 (version 6.0) machine. More information is available here.

If you are running in an immediate custom action, you can read the value of the VersionNT property which will have the correct Windows version.
0 Kudos
rguggisberg
Level 13

🙂 Thanks Josh. VersionNT is correct for Windows 7 as you say. Although as it was pointed out on the link you provided:
"...unfortunately Vista and Server 2008 share the same VersionNT value. This means you have to additionally check to see if the MsiNTProductType = 1 (Server 2008) or 3 (Desktop a.k.a Vista)."
Thanks Again,
Ron
0 Kudos
MattQVI
Level 8

I was just reading in a different post that a MsiNTProductType of 1 is client and >1 is server OS. Wouldn't that mean Vista would be VersionNT = 600 And MsiNTProductType = 1? And Windows 7, VersionNT = 601 And MsiNTProductType = 1?
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Right. If you don't care about differentiating between client and server variants, you can ignore MsiNTProductType. If you need to do something differently between Vista and 2008, or Windows 7 and 2008 R2, then definitely read up on http://msdn.microsoft.com/en-us/library/aa370329(VS.85).aspx
0 Kudos