From 6318bbe1878d54ebc2c19670e6a9d06e1035b95b Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 30 Jun 2025 13:16:59 +0800 Subject: [PATCH] Fix an issue that pm install/uninstall same plugin without restart says correct message but another message also pops up to say it's successfully installed --- Flow.Launcher.Core/Plugin/PluginInstaller.cs | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Flow.Launcher.Core/Plugin/PluginInstaller.cs b/Flow.Launcher.Core/Plugin/PluginInstaller.cs index 781ad3ff0..4cdab09f9 100644 --- a/Flow.Launcher.Core/Plugin/PluginInstaller.cs +++ b/Flow.Launcher.Core/Plugin/PluginInstaller.cs @@ -27,6 +27,13 @@ public static class PluginInstaller public static async Task InstallPluginAndCheckRestartAsync(UserPlugin newPlugin) { + if (API.PluginModified(newPlugin.ID)) + { + API.ShowMsg(string.Format(API.GetTranslation("failedToInstallPluginTitle"), newPlugin.Name), + API.GetTranslation("pluginModifiedAlreadyMessage")); + return; + } + if (API.ShowMsgBox( string.Format( API.GetTranslation("InstallPromptSubtitle"), @@ -117,6 +124,13 @@ public static class PluginInstaller return; } + if (API.PluginModified(plugin.ID)) + { + API.ShowMsg(string.Format(API.GetTranslation("failedToInstallPluginTitle"), plugin.Name), + API.GetTranslation("pluginModifiedAlreadyMessage")); + return; + } + if (Settings.ShowUnknownSourceWarning) { if (!InstallSourceKnown(plugin.Website) @@ -132,6 +146,13 @@ public static class PluginInstaller public static async Task UninstallPluginAndCheckRestartAsync(PluginMetadata oldPlugin) { + if (API.PluginModified(oldPlugin.ID)) + { + API.ShowMsg(string.Format(API.GetTranslation("failedToUninstallPluginTitle"), oldPlugin.Name), + API.GetTranslation("pluginModifiedAlreadyMessage")); + return; + } + if (API.ShowMsgBox( string.Format( API.GetTranslation("UninstallPromptSubtitle"),