diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index 0e6918123..687526c9a 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -2779,8 +2779,15 @@ internal class PluginInstallerWindow : Window, IDisposable // There is no need to set as Complete for an individual plugin installation this.installStatus = OperationStatus.Idle; - var errorMessage = Locs.ErrorModal_SingleUpdateFail(update.UpdateManifest.Name); - return this.DisplayErrorContinuation(task, errorMessage); + if (task.IsCompletedSuccessfully && + task.Result.Status != PluginUpdateStatus.StatusKind.Success) + { + this.ShowErrorModal( + Locs.ErrorModal_SingleUpdateFail(update.UpdateManifest.Name, PluginUpdateStatus.LocalizeUpdateStatusKind(task.Result.Status))); + return false; + } + + return this.DisplayErrorContinuation(task, Locs.ErrorModal_SingleUpdateFail(update.UpdateManifest.Name, "Exception")); }); } @@ -3623,7 +3630,7 @@ internal class PluginInstallerWindow : Window, IDisposable public static string ErrorModal_InstallFail(string name) => Loc.Localize("InstallerInstallFail", "Failed to install plugin {0}.\n{1}").Format(name, ErrorModal_InstallContactAuthor); - public static string ErrorModal_SingleUpdateFail(string name) => Loc.Localize("InstallerSingleUpdateFail", "Failed to update plugin {0}.\n{1}").Format(name, ErrorModal_InstallContactAuthor); + public static string ErrorModal_SingleUpdateFail(string name, string why) => Loc.Localize("InstallerSingleUpdateFail", "Failed to update plugin {0} ({1}).\n{2}").Format(name, why, ErrorModal_InstallContactAuthor); public static string ErrorModal_DeleteConfigFail(string name) => Loc.Localize("InstallerDeleteConfigFail", "Failed to reset the plugin {0}.\n\nThe plugin may not support this action. You can try deleting the configuration manually while the game is shut down - please see the FAQ.").Format(name); diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index c5fda414a..ff6b045be 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -1201,13 +1201,14 @@ internal partial class PluginManager : IDisposable, IServiceType return await response.Content.ReadAsStreamAsync(); } - + /// /// Install a plugin from a repository and load it. /// /// The plugin definition. /// If the testing version should be used. /// The reason this plugin was loaded. + /// Stream of the ZIP archive containing the plugin that is about to be installed. /// WorkingPluginId this plugin should inherit. /// A representing the asynchronous operation. private async Task InstallPluginInternalAsync(RemotePluginManifest repoManifest, bool useTesting, PluginLoadReason reason, Stream zipStream, Guid? inheritedWorkingPluginId = null) diff --git a/Dalamud/Plugin/Internal/Types/PluginUpdateStatus.cs b/Dalamud/Plugin/Internal/Types/PluginUpdateStatus.cs index 391107691..1f20ad960 100644 --- a/Dalamud/Plugin/Internal/Types/PluginUpdateStatus.cs +++ b/Dalamud/Plugin/Internal/Types/PluginUpdateStatus.cs @@ -1,4 +1,3 @@ -using System; using CheapLoc; namespace Dalamud.Plugin.Internal.Types;