View Single Post
Old 12th March 2014, 18:00   #1
Lenge
Member
 
Join Date: Oct 2007
Posts: 64
Windows version detection reloaded

In generalization of the Windows 8.1 detection issues, I have examined the WinVer.nsh and StdUtils.GetRealOSVersion functions under various compatibility mode settings. Some results:
  • On a WinXP-32-SP3 host, the "Windows NT 4.0 (Service Pack 5)" compatibility mode makes WinVer.nsh detect Windows NT 4.0 with Service Pack 3 (instead of 5).
  • On a Win7-64-SP1 host, the same compatibility mode makes WinVer.nsh detect Windows NT 4.0 with Service Pack 5 (as expected).
  • On a Win7-64-SP1 host, the "Windows Server 2003" and "Windows Server 2008" compatibility modes make WinVer.nsh detect non-server versions (WinXP and Vista).
Not sure if these are shortcomings of the respective compatibility modes, the GetVersionEx API, or anything specific to WinVer.nsh. But it obviously fails to reliably detect the exact Windows version it is intended to see by the compatibility mode setting.

StdUtils.GetRealOSVersion aims to detect the "real" Windows version, regardless of any compatibility mode setting or any potentially missing OS support GUIDs in the application manifest. In my tests, the function mostly delivers on that promise, with the following exceptions:
  • On both WinXP-32-SP3 and Win7-64-SP1 hosts, the "Windows 95" and "Windows 98 / Windows Me" compatibility modes make StdUtils.GetRealOSVersion deliver "error" strings instead of the real Windows version.
  • StdUtils currently delivers "real" major and minor version numbers, but neither the "real" build number nor the "real" Service Pack number.
@Mulder: Any chance of according enhancements to StdUtils?
Lenge is offline   Reply With Quote