From 699abf78583f2008893e9ffb5d1c256b878fd252 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 10 Dec 2025 21:55:47 +0100 Subject: [PATCH] Detect the GOG Galaxy version of Morrowind on Windows --- components/files/windowspath.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/files/windowspath.cpp b/components/files/windowspath.cpp index b6b5001774..b0054b18eb 100644 --- a/components/files/windowspath.cpp +++ b/components/files/windowspath.cpp @@ -2,6 +2,7 @@ #if defined(_WIN32) || defined(__WINDOWS__) +#include #include #include @@ -141,12 +142,20 @@ namespace Files if (!disk.empty() && std::filesystem::is_directory(disk)) paths.emplace_back(std::move(disk)); } + { + std::filesystem::path gog = getRegistryPath(L"SOFTWARE\\GOG.com\\Games\\1435828767", L"path", true); + if (!gog.empty() && std::filesystem::is_directory(gog)) + paths.emplace_back(std::move(gog)); + } { std::filesystem::path steam = getRegistryPath( L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Steam App 22320", L"InstallLocation", false); if (!steam.empty() && std::filesystem::is_directory(steam)) paths.emplace_back(std::move(steam)); } + std::ranges::sort(paths); + const auto [first, last] = std::ranges::unique(paths); + paths.erase(first, last); return paths; }