diff --git a/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs b/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs index 8fabb510f3..79e6c069ae 100644 --- a/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs +++ b/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs @@ -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); diff --git a/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs b/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs index 8a840a8801..ac3203783d 100644 --- a/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs +++ b/src/BizHawk.Client.EmuHawk/tools/ExternalToolManager.cs @@ -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); }