mirror of
https://github.com/OpenMW/openmw.git
synced 2026-01-21 22:30:55 +00:00
Merge branch 'gogregistry' into 'master'
Detect the GOG Galaxy version of Morrowind on Windows See merge request OpenMW/openmw!5041
This commit is contained in:
commit
7d9eee3f33
1 changed files with 9 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#if defined(_WIN32) || defined(__WINDOWS__)
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstring>
|
||||
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue