mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Check modified state when updating plugins
This commit is contained in:
parent
ae206c35a5
commit
c06e6d1a6b
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue