Table of Contents

Interface IUpdateSource

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

Where an update's files come from: the checksum list, the signature and the package itself.

public interface IUpdateSource

Remarks

UpdateService is the real one, and reads them from the GitHub release. The seam exists so AppUpdateCoordinator can be run in a test against files made on the spot: the order of the checks, and what each one refuses, is what the update has to get right, and it cannot be tried against a real release without installing it.

Methods

DownloadInstallerAsync(string, string, CancellationToken)

Downloads the package to destPath and returns that path.

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

Parameters

url string
destPath string
ct CancellationToken

Returns

Task<string>

GetExpectedSha256Async(string, string, CancellationToken)

The expected SHA-256 of fileName, or null when it cannot be read.

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

Parameters

sha256SumsUrl string
fileName string
ct CancellationToken

Returns

Task<string>

GetSignatureAsync(string, CancellationToken)

The publisher's signature of the package, or null when it cannot be read.

Task<string?> GetSignatureAsync(string signatureUrl, CancellationToken ct = default)

Parameters

signatureUrl string
ct CancellationToken

Returns

Task<string>