diff options
| author | Chris Bessent <lost.dragonist@gmail.com> | 2021-11-22 16:35:38 -0700 |
|---|---|---|
| committer | Chris Bessent <lost.dragonist@gmail.com> | 2021-11-22 17:12:51 -0700 |
| commit | 9644fef8bdb3b96dfd8b20d1d2c4aa1827521783 (patch) | |
| tree | 0c15c73d9ba9b5f50c3d3c4780e5900c3d3ced77 /src/envwindows.cpp | |
| parent | 1077a5bad0af00bdd113552518eac791b58eeb9a (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
Diffstat (limited to 'src/envwindows.cpp')
| -rw-r--r-- | src/envwindows.cpp | 13 |
1 files changed, 4 insertions, 9 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(); |
