From 0daf52faec6cd38a47955c268d8b316d9791b60f Mon Sep 17 00:00:00 2001 From: Jeremy Date: Tue, 6 Dec 2022 17:38:18 +1100 Subject: [PATCH] remove PythonEmbeddable folder regardless if it's being used or not --- .../Environments/AbstractPluginEnvironment.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher.Core/ExternalPlugins/Environments/AbstractPluginEnvironment.cs b/Flow.Launcher.Core/ExternalPlugins/Environments/AbstractPluginEnvironment.cs index 8c3a50475..c6772677e 100644 --- a/Flow.Launcher.Core/ExternalPlugins/Environments/AbstractPluginEnvironment.cs +++ b/Flow.Launcher.Core/ExternalPlugins/Environments/AbstractPluginEnvironment.cs @@ -42,11 +42,15 @@ namespace Flow.Launcher.Core.ExternalPlugins.Environments return new List(); // TODO: Remove. This is backwards compatibility for 1.10.0 release- changed PythonEmbeded to Environments/Python - if (!string.IsNullOrEmpty(PluginSettings.PythonDirectory) && PluginSettings.PythonDirectory.StartsWith(Path.Combine(DataLocation.DataDirectory(), "PythonEmbeddable"))) + if (Language.Equals(AllowedLanguage.Python, StringComparison.OrdinalIgnoreCase)) { - FilesFolders.RemoveFolderIfExists(PluginSettings.PythonDirectory); - InstallEnvironment(); - PluginSettings.PythonDirectory = string.Empty; + FilesFolders.RemoveFolderIfExists(Path.Combine(DataLocation.DataDirectory(), "PythonEmbeddable")); + + if (!string.IsNullOrEmpty(PluginSettings.PythonDirectory) && PluginSettings.PythonDirectory.StartsWith(Path.Combine(DataLocation.DataDirectory(), "PythonEmbeddable"))) + { + InstallEnvironment(); + PluginSettings.PythonDirectory = string.Empty; + } } if (!string.IsNullOrEmpty(PluginsSettingsFilePath) && FilesFolders.FileExists(PluginsSettingsFilePath))