summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle K <190571+Docteh@users.noreply.github.com>2022-05-21 04:39:12 +0200
committerKyle Kienapfel <Docteh@users.noreply.github.com>2022-05-29 05:48:19 +0200
commit017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde (patch)
treec5222ff015ae77bf6e15bff237852823bc59c5a4
parentMerge pull request #8385 from lat9nq/just-subsys-win (diff)
downloadyuzu-017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde.tar
yuzu-017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde.tar.gz
yuzu-017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde.tar.bz2
yuzu-017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde.tar.lz
yuzu-017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde.tar.xz
yuzu-017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde.tar.zst
yuzu-017a18f42e0a75ba4c2d0f5bf1deabcb2efc5bde.zip
-rw-r--r--src/yuzu/main.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index f4a9a7171..c7fbc7894 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -198,6 +198,31 @@ static void RemoveCachedContents() {
Common::FS::RemoveDirRecursively(offline_system_data);
}
+static QString PrettyProductName() {
+#ifdef _WIN32
+ // After Windows 10 Version 2004, Microsoft decided to switch to a different notation: 20H2
+ // With that notation change they changed the registry key used to denote the current version
+ QSettings windows_registry(
+ QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"),
+ QSettings::NativeFormat);
+ const QString release_id = windows_registry.value(QStringLiteral("ReleaseId")).toString();
+ if (release_id == QStringLiteral("2009")) {
+ const u32 current_build = windows_registry.value(QStringLiteral("CurrentBuild")).toUInt();
+ const QString display_version =
+ windows_registry.value(QStringLiteral("DisplayVersion")).toString();
+ const u32 ubr = windows_registry.value(QStringLiteral("UBR")).toUInt();
+ u32 version = 10;
+ if (current_build >= 22000) {
+ version = 11;
+ }
+ return QStringLiteral("Windows %1 Version %2 (Build %3.%4)")
+ .arg(QString::number(version), display_version, QString::number(current_build),
+ QString::number(ubr));
+ }
+#endif
+ return QSysInfo::prettyProductName();
+}
+
GMainWindow::GMainWindow()
: ui{std::make_unique<Ui::MainWindow>()}, system{std::make_unique<Core::System>()},
input_subsystem{std::make_shared<InputCommon::InputSubsystem>()},
@@ -259,7 +284,7 @@ GMainWindow::GMainWindow()
}
LOG_INFO(Frontend, "Host CPU: {}", cpu_string);
#endif
- LOG_INFO(Frontend, "Host OS: {}", QSysInfo::prettyProductName().toStdString());
+ LOG_INFO(Frontend, "Host OS: {}", PrettyProductName().toStdString());
LOG_INFO(Frontend, "Host RAM: {:.2f} GiB",
Common::GetMemInfo().TotalPhysicalMemory / f64{1_GiB});
LOG_INFO(Frontend, "Host Swap: {:.2f} GiB", Common::GetMemInfo().TotalSwapMemory / f64{1_GiB});