feat: add CheckAndInstallAsync convenience method to UpdateManager

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
erik 2026-02-28 13:11:27 +00:00
parent aed74984c6
commit 57a6946e6b

View file

@ -206,6 +206,26 @@ namespace MosswartMassacre
} }
} }
/// <summary>
/// Check for update and auto-install if available. Used by startup auto-update.
/// </summary>
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() private static string GetLocalDllPath()
{ {
// Get the path to the current DLL // Get the path to the current DLL