feat: add CheckAndInstallAsync convenience method to UpdateManager
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
aed74984c6
commit
57a6946e6b
1 changed files with 20 additions and 0 deletions
|
|
@ -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()
|
||||
{
|
||||
// Get the path to the current DLL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue