This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Detect only Server 2008 R2 ?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 20, 2010
03:56 AM
Detect only Server 2008 R2 ?
Hi
I have basic MSI
Any way ( with install script or system search ) I can detect ONLY Server 2008 R2 ? ( without Win 7 )
I have basic MSI
Any way ( with install script or system search ) I can detect ONLY Server 2008 R2 ? ( without Win 7 )
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 20, 2010
05:52 AM
Try below installscript to obtain windows OS is 2008R2
if (SYSINFO.nISOSL = ISOSL_WIN7_SERVER2008R2) then
if SYSINFO.nOSProductType = VER_NT_WORKSTATION then
// Windows 7
else
// Windows 2008 R2
endif;
endif;
Please check following link for more information http://msdn.microsoft.com/en-us/library/ms724833
if (SYSINFO.nISOSL = ISOSL_WIN7_SERVER2008R2) then
if SYSINFO.nOSProductType = VER_NT_WORKSTATION then
// Windows 7
else
// Windows 2008 R2
endif;
endif;
Please check following link for more information http://msdn.microsoft.com/en-us/library/ms724833
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 22, 2010
11:41 AM
For a basic MSI, I'd suggest referencing the MsiNTProductType Property in concert with the VersionNT property you're likely already using.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 24, 2010
01:02 PM
Take a look at this:
http://msdn.microsoft.com/en-us/library/aa370556(v=VS.85).aspx
You should be able to use properties VersionNT and WindowsBuild to differentiate 2008 R2 from Win7.
http://msdn.microsoft.com/en-us/library/aa370556(v=VS.85).aspx
You should be able to use properties VersionNT and WindowsBuild to differentiate 2008 R2 from Win7.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 27, 2010
12:00 AM
Hi Ron Schaeffer,
I refer the MSDN site, both windows7 and 2008 R2 VersionNT and WindowsBuild properties Values are same(601, greater than 7100) .
Please provide example how to differentiate using VersionNT and WindowsBuild ?
I refer the MSDN site, both windows7 and 2008 R2 VersionNT and WindowsBuild properties Values are same(601, greater than 7100) .
Please provide example how to differentiate using VersionNT and WindowsBuild ?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 18, 2010
03:10 PM
I don't have an example, as I haven't had to do this - I was just trying to provide a link I found that may lead you to a solution.
In that link, there is a comment/question regarding Windows 7 and Windows Server 2008 R2:
VersionNT and VersionNT64 are 601 for Windows 7 and Windows Server 2008 R2. Again, use MsiNTProductType to differentiate (as with Vista vs 2008).
You'll have to research what is meant by this.
In that link, there is a comment/question regarding Windows 7 and Windows Server 2008 R2:
VersionNT and VersionNT64 are 601 for Windows 7 and Windows Server 2008 R2. Again, use MsiNTProductType to differentiate (as with Vista vs 2008).
You'll have to research what is meant by this.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 19, 2010
03:49 PM
Not the most elegant solution, but I created a custom action to call a function in my managed DLL using WMI that's based on this -
http://andrewensley.com/2009/10/c-detect-windows-os-version-%E2%80%93-part-2-wmi/
I clean up the output a bit more than the example, set a property to it's results, and then use that for my comparison tests. There are a ton of different c# examples out there, but a lot of them seem to have the same "VersionNT" and "MsiNTProductType" type challenges I was finding when I played with this recently. There's got to be a more elegant way 🙂
-Mike
http://andrewensley.com/2009/10/c-detect-windows-os-version-%E2%80%93-part-2-wmi/
I clean up the output a bit more than the example, set a property to it's results, and then use that for my comparison tests. There are a ton of different c# examples out there, but a lot of them seem to have the same "VersionNT" and "MsiNTProductType" type challenges I was finding when I played with this recently. There's got to be a more elegant way 🙂
-Mike
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 20, 2010
10:37 AM
There's no need to spin up a custom action for this sort of thing. A condition to check that you're running on (at least) Windows Server 2008 R2 should look like VersionNT >= 601 AND MsiNTProductType > 1 whereas a check for exactly Windows 7 that excludes Server variants should look lik VersionNT = 601 AND MsiNTProductType = 1. To check for a 64-bit OS, substitute VersionNT64 for VersionNT. To require a 64-bit OS, consider changing the template summary, although that yields control of the message to Windows Installer.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)