diff --git a/ObservatoryCore/PluginManagement/PluginCore.cs b/ObservatoryCore/PluginManagement/PluginCore.cs index b4bf280..5e919f0 100644 --- a/ObservatoryCore/PluginManagement/PluginCore.cs +++ b/ObservatoryCore/PluginManagement/PluginCore.cs @@ -156,7 +156,11 @@ namespace Observatory.PluginManagement get { var context = new System.Diagnostics.StackFrame(1).GetMethod(); -#if DEBUG || RELEASE +#if PORTABLE + string? observatoryLocation = System.Diagnostics.Process.GetCurrentProcess()?.MainModule?.FileName; + var obsDir = new FileInfo(observatoryLocation ?? String.Empty).DirectoryName; + return $"{obsDir}{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}{context?.DeclaringType?.Assembly.GetName().Name}-Data{Path.DirectorySeparatorChar}"; +#else string folderLocation = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + $"{Path.DirectorySeparatorChar}ObservatoryCore{Path.DirectorySeparatorChar}{context?.DeclaringType?.Assembly.GetName().Name}{Path.DirectorySeparatorChar}"; @@ -164,10 +168,6 @@ namespace Observatory.PluginManagement Directory.CreateDirectory(folderLocation); return folderLocation; -#elif PORTABLE - string? observatoryLocation = System.Diagnostics.Process.GetCurrentProcess()?.MainModule?.FileName; - var obsDir = new FileInfo(observatoryLocation ?? String.Empty).DirectoryName; - return $"{obsDir}{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}{context?.DeclaringType?.Assembly.GetName().Name}-Data{Path.DirectorySeparatorChar}"; #endif } }