Currently there are 2 WMI queries used to retrieve the operating system release version for Windows:
- SELECT version, producttype FROM Win32_OperatingSystem at
- SELECT version FROM Win32_OperatingSystem at https://github.com/puppetlabs/facter/blob/2.x/lib/facter/kernelrelease.rb#L44
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 -- 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.