feat(launcher): add verified first-run installer

This commit is contained in:
Erik 2026-08-14 20:06:37 +02:00
parent 60f627998c
commit ff6ebb6a6a
28 changed files with 3259 additions and 125 deletions

View file

@ -27,6 +27,11 @@ public static class FileIntegrity
return Convert.ToHexStringLower(hash);
}
/// <summary>
/// Asynchronous, cancellable counterpart used while verifying a multi-
/// gigabyte prepared package. The file stays streamed and no buffer is
/// retained after the hash completes.
/// </summary>
public static async Task<string> ComputeSha256HexAsync(
string filePath,
CancellationToken cancellationToken = default)
@ -38,8 +43,8 @@ public static class FileIntegrity
FileMode.Open,
FileAccess.Read,
FileShare.Read,
bufferSize: 4096,
useAsync: true);
bufferSize: 1024 * 1024,
options: FileOptions.Asynchronous | FileOptions.SequentialScan);
byte[] hash = await SHA256.HashDataAsync(stream, cancellationToken)
.ConfigureAwait(false);
return Convert.ToHexStringLower(hash);