How to determine if OS is Windows Server 2008 R2

Got a problem you cannot solve? Try here.
Post Reply
CFConner
Posts: 85
Joined: Wed Jan 21, 2009 4:14 pm
Location: Syracuse, NY

How to determine if OS is Windows Server 2008 R2

Post by CFConner »

I've done a search, but cannot find if anyone has done a script to determine if the OS is Windows Server 2008 R2.

I need to exclude some runtimes to get my installer working properly in Windows Server 2008 R2. Any help would be appreciated.

=-Chris
CFConner
Posts: 85
Joined: Wed Jan 21, 2009 4:14 pm
Location: Syracuse, NY

Quick test...

Post by CFConner »

Ok, as a quick test, I did the following in my main script:

Set Variable OSVersionR2 to
Get Exact OS Level into OSVersionR2
Write into Text File C:\\info.txt from Value $OSVersionR2$ (at end of file)

It reports back to me SEVEN (which is what I expect)

Then I tried this:

Get System Setting Windows 2008 into OSVersionR2
Write into Text File C:\\info.txt from value $OSVersionR2$ (at end of file)

The info.txt file reports this:

SEVEN
FALSE

Ok, So I know it is not Windows 7 CLIENT (as opposed to Windows 7 Server (which is What Windows 2008 R2 is)

I change the above to do this:

Get System Setting Windows 7 into OSVersionR2
Write into Text File C:\\info.txt from value $OSVersionR2$ (at end of file)

Now I get:

SEVEN
TRUE

How do I tell the difference between Windows 7 CLIENT and Windows 2008 R2 SERVER?

The GetSystemSettings does not list R2 as an OS to select yet :).

=-Chris
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

I'd check for SEVEN, and then for server capability using Get System Setting Windows with Server Features into...
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Tiago
Posts: 129
Joined: Thu Jun 18, 2009 9:08 am

Post by Tiago »

Hmmm... great tip.

What if I want to detect if I'm running under Windows XP Home or Windows XP Professional?

Thank you very much.
[b]Tiago Rocha[/b]
[i]Product Technology[/i]
www.ppi-multitask.com.br
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Tiago, please do not post the same question to three different topics - this is dangerously close to spamming and can get you banned.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Tiago
Posts: 129
Joined: Thu Jun 18, 2009 9:08 am

Post by Tiago »

Sorry for that, Michael and thanks for your answer in the other topic (http://www.installaware.com/forums/view ... 9484#19484). Perhaps it may provide a clue or insight to people who are trying to detect Windows Server 2008 R2 and other Windows sub-versions, too?

Thank you so very much!
[b]Tiago Rocha[/b]
[i]Product Technology[/i]
www.ppi-multitask.com.br
Post Reply