Steam and Gog resolvers now take IDFiles into account.

This commit is contained in:
IceReaper
2023-03-30 12:27:31 +02:00
committed by Matthias Mailänder
parent 56c0680685
commit d97df78f4f
2 changed files with 13 additions and 3 deletions

View File

@@ -34,8 +34,13 @@ namespace OpenRA.Mods.Common.Installer
var prefixes = new[] { "HKEY_LOCAL_MACHINE\\Software\\", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\" };
foreach (var prefix in prefixes)
if (Registry.GetValue($"{prefix}GOG.com\\Games\\{appId.Value}", "path", null) is string installDir)
{
if (!(Registry.GetValue($"{prefix}GOG.com\\Games\\{appId.Value}", "path", null) is string installDir))
continue;
if (InstallerUtils.IsValidSourcePath(installDir, modSource))
return installDir;
}
return null;
}

View File

@@ -43,8 +43,13 @@ namespace OpenRA.Mods.Common.Installer
if (!data.TryGetValue("installdir", out var installDir))
continue;
if (installDir != null)
return Path.Combine(steamDirectory, "steamapps", "common", installDir);
if (installDir == null)
continue;
var path = Path.Combine(steamDirectory, "steamapps", "common", installDir);
if (InstallerUtils.IsValidSourcePath(path, modSource))
return path;
}
return null;