From 9644fef8bdb3b96dfd8b20d1d2c4aa1827521783 Mon Sep 17 00:00:00 2001 From: Chris Bessent Date: Mon, 22 Nov 2021 16:35:38 -0700 Subject: Update Windows detection Windows 11 reports itself as Windows 10 using the methods normally employed. Microsoft seems to want people to use the BuildId to identify the version of Windows but I'm going to refuse to do that because it's stupid. This change also prefers DisplayVersion over ReleaseId as somehow I have both and DisplayVersion is more correct (21H2 vs 2009). /shrug. Fixes #1607 --- src/envwindows.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/envwindows.cpp') diff --git a/src/envwindows.cpp b/src/envwindows.cpp index 98e78a3e..a2019fab 100644 --- a/src/envwindows.cpp +++ b/src/envwindows.cpp @@ -94,11 +94,6 @@ QString WindowsInfo::toString() const sl.push_back(m_release.buildLab); } - // product name - if (!m_release.productName.isEmpty()) { - sl.push_back(m_release.productName); - } - // elevated QString elevated = "?"; if (m_elevated.has_value()) { @@ -187,11 +182,11 @@ WindowsInfo::Release WindowsInfo::getRelease() const } } - // localized name of windows, such as "Windows 10 Pro" - r.productName = settings.value("ProductName", "").toString(); - // release ID, such as 1803 - r.ID = settings.value("ReleaseId", "").toString(); + r.ID = settings.value("DisplayVersion", "").toString(); + if (r.ID.isEmpty()) { + r.ID = settings.value("ReleaseId", "").toString(); + } // some other build number, shown in winver.exe r.UBR = settings.value("UBR", 0).toUInt(); -- cgit v1.3.1