summaryrefslogtreecommitdiffstats
path: root/src/main.lib/Services/PluginService.cs
diff options
context:
space:
mode:
authorWouterTinus <wouter.tinus@gmail.com>2019-09-29 23:28:42 +0200
committerWouterTinus <wouter.tinus@gmail.com>2019-09-29 23:28:42 +0200
commit658ca8b57e70cfb1c5c27e78ff7697e7e65c58e9 (patch)
treea2b6e9e75d31f63c5cd9bba0914f6428fec9143c /src/main.lib/Services/PluginService.cs
parentbef36f6424d4782c0b30af3c92af9824358f06fa (diff)
downloadletsencrypt-win-simple-658ca8b57e70cfb1c5c27e78ff7697e7e65c58e9.zip
letsencrypt-win-simple-658ca8b57e70cfb1c5c27e78ff7697e7e65c58e9.tar.gz
letsencrypt-win-simple-658ca8b57e70cfb1c5c27e78ff7697e7e65c58e9.tar.bz2
huge settings refactoring
Diffstat (limited to 'src/main.lib/Services/PluginService.cs')
-rw-r--r--src/main.lib/Services/PluginService.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main.lib/Services/PluginService.cs b/src/main.lib/Services/PluginService.cs
index c99da68..13babcb 100644
--- a/src/main.lib/Services/PluginService.cs
+++ b/src/main.lib/Services/PluginService.cs
@@ -4,6 +4,7 @@ using PKISharp.WACS.Services.Interfaces;
using PKISharp.WACS.Services.Serialization;
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
@@ -177,14 +178,24 @@ namespace PKISharp.WACS.Services
}
// Try loading additional dlls in the current dir to attempt to find plugin types in them
- var baseDir = AppDomain.CurrentDomain.BaseDirectory;
- var allFiles = Directory.EnumerateFileSystemEntries(baseDir, "*.dll", SearchOption.AllDirectories);
+ var installDir = new FileInfo(Process.GetCurrentProcess().MainModule.FileName).Directory;
+ var runDir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
+ if (!string.Equals(installDir.FullName.TrimEnd('\\'), runDir.FullName.TrimEnd('\\'), StringComparison.CurrentCultureIgnoreCase))
+ {
+ foreach (var x in installDir.GetFiles("*.dll", SearchOption.AllDirectories))
+ {
+ _log.Verbose("PluginService copying {x} to {y}", x.Name, runDir);
+ x.CopyTo(Path.Combine(runDir.FullName, x.Name), true);
+ }
+ }
+
+ var allFiles = runDir.GetFiles("*.dll", SearchOption.AllDirectories);
foreach (var file in allFiles)
{
IEnumerable<Type> types = new List<Type>();
try
{
- var name = AssemblyName.GetAssemblyName(file);
+ var name = AssemblyName.GetAssemblyName(file.FullName);
var assembly = Assembly.Load(name);
if (!scanned.Contains(assembly))
{