feat(desktop): self-update appimages in place (#2843)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-19 19:06:53 +02:00
1 parent 98a42f612b
commit c4f0b2ece0
20 files changed
+2210 -57

No files matched your search

+12 -2
View File
@@ -696,10 +696,14 @@ class Updater {
} finally {
this.transition({type: 'manualDownload.finished'});
}
await this.downloadManualNativeUpdateOrOpen(currentOption.url, currentOption.suggestedName);
await this.downloadManualNativeUpdateOrOpen(currentOption.url, currentOption.suggestedName, currentOption.sha256);
}
private async downloadManualNativeUpdateOrOpen(url: string, suggestedName?: string): Promise<void> {
private async downloadManualNativeUpdateOrOpen(
url: string,
suggestedName?: string,
sha256?: string | null,
): Promise<void> {
if (this.manualNativeDownloadInFlight) {
return;
}
@@ -708,10 +712,16 @@ class Updater {
const outcome = await downloadWithNative({
url,
suggestedName: suggestedName ?? this.getManualUpdateSuggestedName(url),
sha256,
});
if (outcome === 'success' || outcome === 'canceled') {
return;
}
if (outcome === 'checksum-mismatch') {
logger.error('Native manual update download did not match its published checksum', {url});
pushDesktopUpdateDownloadFailedModal();
return;
}
logger.warn('Native manual update download unavailable; opening update URL externally', {outcome});
await openExternalUrl(url);
} finally {
@@ -5,5 +5,5 @@ export function shouldShowNativeDesktopUpdateInApp(platform: string | null | und
}
export function shouldShowNativeDesktopUpdateDownloadProgress(platform: string | null | undefined): boolean {
return platform === 'win32';
return platform === 'win32' || platform === 'linux';
}