Make external tools path independent of working directory (squashed PR #3987)
* Make external tools path independent of working directory * Add `ExternalToolsAbsolutePath` extension * Use absolute path for external tool dependencies as well
This commit is contained in:
parent
494fe90bfc
commit
cdf79d3593
|
@ -180,6 +180,12 @@ namespace BizHawk.Client.Common
|
|||
return collection.AbsolutePathFor(path, null);
|
||||
}
|
||||
|
||||
public static string ExternalToolsAbsolutePath(this PathEntryCollection collection)
|
||||
{
|
||||
var path = collection[PathEntryCollection.GLOBAL, "External Tools"].Path;
|
||||
return collection.AbsolutePathFor(path, null);
|
||||
}
|
||||
|
||||
public static string MultiDiskAbsolutePath(this PathEntryCollection collection)
|
||||
{
|
||||
var path = collection.ResolveToolsPath(collection[PathEntryCollection.GLOBAL, "Multi-Disk Bundles"].Path);
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
DirectoryMonitor.Created -= DirectoryMonitor_Created;
|
||||
DirectoryMonitor.Dispose();
|
||||
}
|
||||
var path = _config.PathEntries[PathEntryCollection.GLOBAL, "External Tools"].Path;
|
||||
var path = _config.PathEntries.ExternalToolsAbsolutePath();
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
DirectoryMonitor = new FileSystemWatcher(path, "*.dll")
|
||||
|
@ -153,7 +153,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
foreach (var depFilename in toolAttribute.LoadAssemblyFiles)
|
||||
{
|
||||
var depFilePath = $"{_config.PathEntries[PathEntryCollection.GLOBAL, "External Tools"].Path}/{depFilename}";
|
||||
var depFilePath = Path.Combine(_config.PathEntries.ExternalToolsAbsolutePath(), depFilename);
|
||||
Console.WriteLine($"preloading assembly {depFilePath} requested by ext. tool {toolAttribute.Name}");
|
||||
Assembly.LoadFrom(depFilePath);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue