diff --git a/StabilityMatrix/Helper/SettingsManager.cs b/StabilityMatrix/Helper/SettingsManager.cs index 14a14529..c35c4731 100644 --- a/StabilityMatrix/Helper/SettingsManager.cs +++ b/StabilityMatrix/Helper/SettingsManager.cs @@ -7,6 +7,7 @@ using System.Text.Json.Serialization; using System.Threading; using NLog; using StabilityMatrix.Models; +using StabilityMatrix.Python; using Wpf.Ui.Controls.Window; namespace StabilityMatrix.Helper; @@ -74,8 +75,8 @@ public class SettingsManager : ISettingsManager // Set static classes requiring library path private void SetStaticLibraryPaths() { - // ArchiveHelper ArchiveHelper.HomeDir = LibraryDir; + PyRunner.HomeDir = LibraryDir; } /// diff --git a/StabilityMatrix/Python/PyRunner.cs b/StabilityMatrix/Python/PyRunner.cs index daf8874c..6cb155b5 100644 --- a/StabilityMatrix/Python/PyRunner.cs +++ b/StabilityMatrix/Python/PyRunner.cs @@ -14,9 +14,9 @@ public record struct PyVersionInfo(int Major, int Minor, int Micro, string Relea public class PyRunner : IPyRunner { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - - private static readonly string AppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - private static readonly string HomeDir = Path.Combine(AppDataDir, "StabilityMatrix"); + + // Set by ISettingsManager.TryFindLibrary() + public static string HomeDir { get; set; } = string.Empty; public static string PythonDir => Path.Combine(HomeDir, "Assets", "Python310"); public static string PythonDllPath => Path.Combine(PythonDir, "python310.dll");