diff --git a/OpenRA.Mods.Common/ModContent.cs b/OpenRA.Mods.Common/ModContent.cs index b3d5836f93..306647deec 100644 --- a/OpenRA.Mods.Common/ModContent.cs +++ b/OpenRA.Mods.Common/ModContent.cs @@ -43,6 +43,7 @@ namespace OpenRA public readonly SourceType Type = SourceType.Disc; // Used to find installation locations for SourceType.Install + public readonly string[] RegistryPrefixes = { string.Empty }; public readonly string RegistryKey; public readonly string RegistryValue; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs index 549f06ef58..6579952a74 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs @@ -481,11 +481,16 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (Platform.CurrentPlatform != PlatformType.Windows) return null; - var path = Microsoft.Win32.Registry.GetValue(source.RegistryKey, source.RegistryValue, null) as string; - if (path == null) - return null; + foreach (var prefix in source.RegistryPrefixes) + { + var path = Microsoft.Win32.Registry.GetValue(prefix + source.RegistryKey, source.RegistryValue, null) as string; + if (path == null) + continue; - return IsValidSourcePath(path, source) ? path : null; + return IsValidSourcePath(path, source) ? path : null; + } + + return null; } if (source.Type == ModContent.SourceType.Disc)