Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-1395

Replace Facter 2.x WMI Operating System kernel query with Windows API

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: FACT 2.4.6
    • Fix Version/s: FACT 2.4.7, FACT 2.5.0
    • Component/s: Windows
    • Labels:
      None

      Description

      Currently there are 2 WMI queries used to retrieve the operating system release version for Windows:

      To enable broader OS support, we can simply use the GetVersionEx API call, as long as we use the OSVERSIONINFOEX structure to retrieve wProductType

      Note that as of Windows 8.1, there are some interesting notes about how that API has changed that are worth validating -

      Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2). Once an application is manifested for a given operating system version, GetVersionEx will always return the version that the application is manifested for in future releases. To manifest your applications for Windows 8.1 or Windows 10, refer to Targeting your application for Windows.
      

      - this points to docs at https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx

      Alternatively, we can use GetProductInfo, which requires a minimum of Windows 2008 and will return Major / Minor versions, but not the equivalent of wProductType, which is used for some older 2003 / XP detection (that could probably be rewritten).

      There are also some Version Helper APIs, but it's unclear which OS version they support.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                glenn.sarti Glenn Sarti
                Reporter:
                ethan Ethan Brown
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support