From c06e6d1a6b6b5df09dc3d8437a8b35ffd6c606c1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 3 Jul 2025 20:53:15 +0800 Subject: [PATCH] Check modified state when updating plugins --- Flow.Launcher.Core/Plugin/PluginManager.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index c6e14dcb9..a3e451b62 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -549,10 +549,19 @@ namespace Flow.Launcher.Core.Plugin public static async Task UpdatePluginAsync(PluginMetadata existingVersion, UserPlugin newVersion, string zipFilePath) { + if (PluginModified(existingVersion.ID)) + { + API.ShowMsgError(string.Format(API.GetTranslation("pluginModifiedAlreadyTitle"), existingVersion.Name), + API.GetTranslation("pluginModifiedAlreadyMessage")); + return false; + } + var installSuccess = InstallPlugin(newVersion, zipFilePath, checkModified:false); if (!installSuccess) return false; + var uninstallSuccess = await UninstallPluginAsync(existingVersion, removePluginFromSettings:false, removePluginSettings:false, checkModified: false); if (!uninstallSuccess) return false; + _modifiedPlugins.Add(existingVersion.ID); return true; }