summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Bessent <lost.dragonist@gmail.com>2021-11-22 16:35:38 -0700
committerChris Bessent <lost.dragonist@gmail.com>2021-11-22 17:12:51 -0700
commit9644fef8bdb3b96dfd8b20d1d2c4aa1827521783 (patch)
tree0c15c73d9ba9b5f50c3d3c4780e5900c3d3ced77
parent1077a5bad0af00bdd113552518eac791b58eeb9a (diff)
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
-rw-r--r--src/envwindows.cpp13
-rw-r--r--src/envwindows.h6
2 files changed, 5 insertions, 14 deletions
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();
diff --git a/src/envwindows.h b/src/envwindows.h
index 90655e49..61ef609d 100644
--- a/src/envwindows.h
+++ b/src/envwindows.h
@@ -40,11 +40,7 @@ public:
// the BuildLab entry from the registry, may be empty
QString buildLab;
- // product name such as "Windows 10 Pro", may not be in English, may be
- // empty
- QString productName;
-
- // release ID such as 1809, may be mepty
+ // release ID such as 1809, may be empty
QString ID;
// some sub-build number, undocumented, may be empty