Loading
  • 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
    Expand Post
  • 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 ?
    Expand Post
  • 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.
    Expand Post
  • 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
    Expand Post
  • 0_M Urman (Flexera Software)

    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.
    Expand Post

Loading
Detect only Server 2008 R2 ?