diff --git a/OpenRA.Mods.Common/ModContent.cs b/OpenRA.Mods.Common/ModContent.cs index c4ecf0c732..5f979b4e13 100644 --- a/OpenRA.Mods.Common/ModContent.cs +++ b/OpenRA.Mods.Common/ModContent.cs @@ -17,7 +17,7 @@ namespace OpenRA { public class ModContent : IGlobalModData { - public enum SourceType { Disc, Install } + public enum SourceType { Disc, RegistryDirectory, RegistryDirectoryFromFile } public class ModPackage { public readonly string Title; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs index 3051e69fc5..8069e5054c 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallFromDiscLogic.cs @@ -175,7 +175,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (Platform.CurrentPlatform == PlatformType.Windows) { var installations = missingSources - .Where(s => s.Type == ModContent.SourceType.Install) + .Where(s => s.Type == ModContent.SourceType.RegistryDirectory || s.Type == ModContent.SourceType.RegistryDirectoryFromFile) .Select(s => s.Title) .Distinct(); @@ -464,7 +464,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic string FindSourcePath(ModContent.ModSource source, IEnumerable volumes) { - if (source.Type == ModContent.SourceType.Install) + if (source.Type == ModContent.SourceType.RegistryDirectory || source.Type == ModContent.SourceType.RegistryDirectoryFromFile) { if (source.RegistryKey == null) return null; @@ -478,6 +478,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (path == null) continue; + if (source.Type == ModContent.SourceType.RegistryDirectoryFromFile) + path = Path.GetDirectoryName(path); + return IsValidSourcePath(path, source) ? path : null; } diff --git a/mods/cnc/installer/origin.yaml b/mods/cnc/installer/origin.yaml index 769be7c694..33e3fc7421 100644 --- a/mods/cnc/installer/origin.yaml +++ b/mods/cnc/installer/origin.yaml @@ -1,5 +1,5 @@ origin: C&C The Ultimate Collection (Origin version, English) - Type: Install + Type: RegistryDirectory RegistryPrefixes: HKEY_LOCAL_MACHINE\Software\, HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ RegistryKey: EA Games\CNC and The Covert Operations RegistryValue: Install Dir diff --git a/mods/d2k/installer/gruntmods.yaml b/mods/d2k/installer/gruntmods.yaml index c56ebaffb0..6a3abf4c57 100644 --- a/mods/d2k/installer/gruntmods.yaml +++ b/mods/d2k/installer/gruntmods.yaml @@ -1,5 +1,5 @@ gruntmods: Dune 2000: GruntMods Edition - Type: Install + Type: RegistryDirectory RegistryPrefixes: HKEY_LOCAL_MACHINE\Software\, HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ RegistryKey: Dune 2000: Gruntmods Edition IDFiles: diff --git a/mods/ra/installer/origin.yaml b/mods/ra/installer/origin.yaml index aaaf54cf84..e097b240f7 100644 --- a/mods/ra/installer/origin.yaml +++ b/mods/ra/installer/origin.yaml @@ -1,5 +1,5 @@ ra-origin: C&C The Ultimate Collection (Origin version, English) - Type: Install + Type: RegistryDirectory RegistryPrefixes: HKEY_LOCAL_MACHINE\Software\, HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ RegistryKey: EA Games\Command and Conquer Red Alert RegistryValue: Install Dir @@ -457,7 +457,7 @@ ra-origin: C&C The Ultimate Collection (Origin version, English) Length: 9073 cnc-origin: Command & Conquer (Origin version, English) - Type: Install + Type: RegistryDirectory RegistryPrefixes: HKEY_LOCAL_MACHINE\Software\, HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ RegistryKey: EA Games\CNC and The Covert Operations RegistryValue: Install Dir @@ -465,4 +465,4 @@ cnc-origin: Command & Conquer (Origin version, English) CONQUER.MIX: 833e02a09aae694659eb312d3838367f681d1b30 Install: copy: . - ^SupportDir|Content/ra/v2/cnc/desert.mix: DESERT.MIX \ No newline at end of file + ^SupportDir|Content/ra/v2/cnc/desert.mix: DESERT.MIX diff --git a/mods/ts/installer/origin.yaml b/mods/ts/installer/origin.yaml index 382b2c4bfd..74f1bcd6d6 100644 --- a/mods/ts/installer/origin.yaml +++ b/mods/ts/installer/origin.yaml @@ -1,5 +1,5 @@ origin: C&C The Ultimate Collection (Origin version, English) - Type: Install + Type: RegistryDirectory RegistryPrefixes: HKEY_LOCAL_MACHINE\Software\, HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ RegistryKey: EA Games\Command and Conquer Tiberian Sun RegistryValue: Install Dir