From 4d6f7762e664cac218a3221cbdfeb5057d6e4d63 Mon Sep 17 00:00:00 2001 From: goat Date: Tue, 31 Mar 2020 23:43:15 +0900 Subject: [PATCH] fix: create all .disabled files for previous versions, just to be safe --- Dalamud/Plugin/PluginRepository.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Dalamud/Plugin/PluginRepository.cs b/Dalamud/Plugin/PluginRepository.cs index 0f386b1d1..af8ff3326 100644 --- a/Dalamud/Plugin/PluginRepository.cs +++ b/Dalamud/Plugin/PluginRepository.cs @@ -142,11 +142,6 @@ namespace Dalamud.Plugin // DisablePlugin() below immediately creates a .disabled file anyway, but will fail // with an exception if we try to do it twice in row like this - // TODO: not sure if doing this for all versions is really necessary, since the - // others really needed to be disabled before anyway - //foreach (var sortedVersion in sortedVersions) { - // File.Create(Path.Combine(sortedVersion.FullName, ".disabled")); - //} if (!dryRun) { @@ -161,6 +156,18 @@ namespace Dalamud.Plugin hasError = true; } + try { + // Just to be safe + foreach (var sortedVersion in sortedVersions) + { + var disabledFile = new FileInfo(Path.Combine(sortedVersion.FullName, ".disabled")); + if (!disabledFile.Exists) + disabledFile.Create(); + } + } catch (Exception ex) { + Log.Error(ex, "Plugin disable failed"); + } + var installSuccess = InstallPlugin(remoteInfo); if (installSuccess)