Table of Contents

Class UpdateService

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

Checks the GitHub Releases for a version newer than the installed one.

public class UpdateService
Inheritance
UpdateService
Inherited Members

Methods

CheckAsync(Version, CancellationToken)

Returns the latest version if it is newer than current; otherwise null.

public Task<UpdateService.UpdateInfo?> CheckAsync(Version current, CancellationToken ct = default)

Parameters

current Version
ct CancellationToken

Returns

Task<UpdateService.UpdateInfo>

DownloadInstallerAsync(string, string, CancellationToken)

Downloads the installer to destPath. Returns the downloaded path.

public Task<string> DownloadInstallerAsync(string url, string destPath, CancellationToken ct = default)

Parameters

url string
destPath string
ct CancellationToken

Returns

Task<string>

GetExpectedSha256Async(string, string, CancellationToken)

Reads the expected checksum for fileName from a "SHA256SUMS.txt"-style asset (lines of "<hex> <filename>", one per file). Returns null if the asset is unreachable, malformed, or has no entry for that file — the in-app updater treats that as a refusal to run the installer (verification is mandatory), falling back to the release page.

public Task<string?> GetExpectedSha256Async(string sha256SumsUrl, string fileName, CancellationToken ct = default)

Parameters

sha256SumsUrl string
fileName string
ct CancellationToken

Returns

Task<string>