From c18ae41e56f5b38ca4d702e58fa691e29ad7743d Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sun, 12 Nov 2023 11:42:13 +0800 Subject: [PATCH] Delete existing zip before downloading --- .../PluginsManager.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs index 3cfae97d5..00f77f872 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs @@ -143,6 +143,11 @@ namespace Flow.Launcher.Plugin.PluginsManager try { + if (File.Exists(filePath)) + { + File.Delete(filePath); + } + await Http.DownloadAsync(plugin.UrlDownload, filePath).ConfigureAwait(false); Install(plugin, filePath); @@ -245,6 +250,11 @@ namespace Flow.Launcher.Plugin.PluginsManager _ = Task.Run(async delegate { + if (File.Exists(downloadToFilePath)) + { + File.Delete(downloadToFilePath); + } + await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath) .ConfigureAwait(false);