mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-26 19:34:04 +01:00
Better update handling on Linux
This commit is contained in:
@@ -64,12 +64,19 @@ export function initLinux({ logger, getMainWindow }: UpdaterOptionsType): void {
|
||||
app.quit();
|
||||
});
|
||||
|
||||
// In `postinst` script we run `touch .signal-postinst`.
|
||||
// See our patch for app-builder-lib.
|
||||
//
|
||||
// /opt/Signal/resources/app.asar
|
||||
const asarPath = join(__dirname, '..', '..');
|
||||
if (!asarPath.endsWith('.asar')) {
|
||||
throw new Error('updater/linux: not running from ASAR');
|
||||
}
|
||||
|
||||
watch(asarPath, event => {
|
||||
// /opt/Signal/.signal-postinst
|
||||
const postinstFile = join(asarPath, '..', '..', '.signal-postinst');
|
||||
|
||||
watch(postinstFile, event => {
|
||||
if (event !== 'change') {
|
||||
return;
|
||||
}
|
||||
@@ -86,6 +93,11 @@ export function initLinux({ logger, getMainWindow }: UpdaterOptionsType): void {
|
||||
return;
|
||||
}
|
||||
|
||||
if (version === app.getVersion()) {
|
||||
logger?.info('updater/linux: ignoring asar update, no version change');
|
||||
return;
|
||||
}
|
||||
|
||||
logger?.info(`updater/linux: asar updated to version=${version}`);
|
||||
getMainWindow()?.webContents.send(
|
||||
'show-update-dialog',
|
||||
|
||||
Reference in New Issue
Block a user