Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.14
-
None
Description
Tested against the Server 2022 preview:
QSysInfo::productVersion() returns "server2016"
QSysInfo::prettyProductName() returns "Windows Server 2016 (10.0)".
Looking at the code in qoperatingsystemversion_win.cpp, it looks like the returned OSVERSIONINFOEX only supports up to Server 2016 (documentation).
I think a better solution may be to pull the name from the register using something like (semi-psudocode):
QString sPlatform; DWORD dataSize = 100 * sizeof(wchar_t); LONG retCode = ::RegGetValue(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", L"ProductName", RRF_RT_REG_SZ, nullptr, &sPlatform[0], &dataSize); if (retCode != ERROR_SUCCESS) { sPlatform = "Unknown Windows platform"; }
Some examples of what this returns:
Windows Server 2022 Standard Evaluation Windows Server 2008 R2 Enterprise Windows 10 Pro
Given the nature of Windows 10, and how Windows 10 in 2015 is very different to Windows 10 in 2021 it may be good to also include some more info (ie: 21H1, 2004, redstone1, basically one of the columns here)