diff --git a/MosswartMassacre/UpdateManager.cs b/MosswartMassacre/UpdateManager.cs index 7f85741..6eaa70c 100644 --- a/MosswartMassacre/UpdateManager.cs +++ b/MosswartMassacre/UpdateManager.cs @@ -206,6 +206,26 @@ namespace MosswartMassacre } } + /// + /// Check for update and auto-install if available. Used by startup auto-update. + /// + public static async Task CheckAndInstallAsync() + { + try + { + bool checkOk = await CheckForUpdateAsync(); + if (checkOk && updateAvailable) + { + PluginCore.WriteToChat("[Update] Auto-installing update..."); + await DownloadAndInstallUpdateAsync(); + } + } + catch (Exception ex) + { + PluginCore.WriteToChat($"[Update] Auto-update failed: {ex.Message}"); + } + } + private static string GetLocalDllPath() { // Get the path to the current DLL