public async Task DownloadAndApplyUpdateAsync(IProgress<DownloadProgress> progress) { var manifest = await GetManifestAsync(); string tempFile = Path.GetTempFileName() + ".exe";
using (var fileStream = new FileStream(tempFile, FileMode.Create)) { await _http.DownloadDataAsync(manifest.updaterFile.url, fileStream, progress); } Download OmniGlyph V 6 Updaterar
// Launch updater Process.Start(new ProcessStartInfo { FileName = tempFile, Arguments = string.Join(" ", manifest.updaterFile.arguments), UseShellExecute = true }); public async Task DownloadAndApplyUpdateAsync(IProgress<
// Verify hash using (var sha256 = SHA256.Create()) using (var stream = File.OpenRead(tempFile)) { var hash = sha256.ComputeHash(stream); if (!BitConverter.ToString(hash).Replace("-", "").Equals(manifest.updaterFile.sha256, StringComparison.OrdinalIgnoreCase)) throw new Exception("Checksum mismatch – possible corruption."); } string tempFile = Path.GetTempFileName() + ".exe"
_manifestUrl = json.manifestUrl; return true; }
{ "version": "6.2.1", "releaseDate": "2025-03-15", "mandatory": false, "updaterFile": { "url": "https://updates.omniglyph.com/v6/OmniGlyph_V6_Updaterar.exe", "sizeBytes": 45728000, "sha256": "a1b2c3...", "arguments": ["/silent", "/norestart"] }, "changelog": "Fixed glyph rendering bug, added variable font support." } GET /api/updater/latest?platform=win64¤t=6.2.0