From bcf046f842b404d4583048aabc97c0c18612d6a2 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Wed, 3 Feb 2021 20:51:19 +1100 Subject: [PATCH] fix move method call only restricted to within the same drive --- .../Search/ResultManager.cs | 2 -- .../PluginsManager.cs | 9 +++++++-- Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 600b573cfe5..6872f04b445 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -1,10 +1,8 @@ using Flow.Launcher.Infrastructure; using Flow.Launcher.Plugin.SharedCommands; using System; -using System.Diagnostics; using System.IO; using System.Linq; -using System.Runtime.CompilerServices; using System.Windows; namespace Flow.Launcher.Plugin.Explorer.Search diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs index 0f5e6d9e8b9..881872fc138 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs @@ -3,6 +3,7 @@ using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin.PluginsManager.Models; +using Flow.Launcher.Plugin.SharedCommands; using System; using System.Collections.Generic; using System.IO; @@ -327,7 +328,9 @@ private void Install(UserPlugin plugin, string downloadedFilePath) var zipFilePath = Path.Combine(tempFolderPath, Path.GetFileName(downloadedFilePath)); - File.Move(downloadedFilePath, zipFilePath); + File.Copy(downloadedFilePath, zipFilePath); + + File.Delete(downloadedFilePath); Utilities.UnZip(zipFilePath, tempFolderPluginPath, true); @@ -345,7 +348,9 @@ private void Install(UserPlugin plugin, string downloadedFilePath) string newPluginPath = Path.Combine(DataLocation.PluginsDirectory, $"{plugin.Name}-{plugin.Version}"); - Directory.Move(pluginFolderPath, newPluginPath); + FilesFolders.CopyAll(pluginFolderPath, newPluginPath); + + Directory.Delete(pluginFolderPath, true); } internal List RequestUninstall(string search) diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json index 75d6038d431..b37a6b1afef 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json @@ -6,7 +6,7 @@ "Name": "Plugins Manager", "Description": "Management of installing, uninstalling or updating Flow Launcher plugins", "Author": "Jeremy Wu", - "Version": "1.6.1", + "Version": "1.6.2", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",