Extract the directory if the registry value points to a filename.
This commit is contained in:
committed by
reaperrr
parent
1f6e0f582a
commit
e13fd4816e
@@ -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;
|
||||
|
||||
@@ -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<string> 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user