From 4533781b2f072d5ef328e2b9bc61ce3ff7f2361b Mon Sep 17 00:00:00 2001 From: goat Date: Wed, 18 Mar 2020 12:19:32 +0900 Subject: [PATCH] fix: disable ALL previous versions regardless --- Dalamud/Plugin/PluginInstallerWindow.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dalamud/Plugin/PluginInstallerWindow.cs b/Dalamud/Plugin/PluginInstallerWindow.cs index 8ff71a132..6497c299b 100644 --- a/Dalamud/Plugin/PluginInstallerWindow.cs +++ b/Dalamud/Plugin/PluginInstallerWindow.cs @@ -73,7 +73,7 @@ namespace Dalamud.Plugin continue; } - var sortedVersions = versions.OrderBy(x => x.CreationTime); + var sortedVersions = versions.OrderBy(x => int.Parse(x.Name.Replace(".",""))); var latest = sortedVersions.Last(); var localInfoFile = new FileInfo(Path.Combine(latest.FullName, $"{installed.Name}.json")); @@ -96,7 +96,17 @@ namespace Dalamud.Plugin if (remoteInfo.AssemblyVersion != info.AssemblyVersion) { - this.manager.DisablePlugin(info); + foreach (var sortedVersion in sortedVersions) { + File.Create(Path.Combine(sortedVersion.FullName, ".disabled")); + } + + // Try to disable plugin if it is loaded + try { + this.manager.DisablePlugin(info); + } catch { + // ignored + } + InstallPlugin(remoteInfo); } }