Check modified state when updating plugins

This commit is contained in:
Jack251970 2025-07-03 20:53:15 +08:00
parent ae206c35a5
commit c06e6d1a6b

View file

@ -549,10 +549,19 @@ namespace Flow.Launcher.Core.Plugin
public static async Task<bool> 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;
}