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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user