Better update handling on Linux
This commit is contained in:
parent
9e70387a9e
commit
0d89e7b01a
4 changed files with 38 additions and 22 deletions
|
@ -104,7 +104,7 @@
|
|||
"fs-xattr": "0.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@electron/asar": "3.3.1",
|
||||
"@electron/asar": "3.4.1",
|
||||
"@formatjs/fast-memoize": "2.2.3",
|
||||
"@formatjs/icu-messageformat-parser": "2.9.3",
|
||||
"@formatjs/intl-localematcher": "0.2.32",
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
diff --git a/templates/linux/after-install.tpl b/templates/linux/after-install.tpl
|
||||
index 6cf860bd2847bae35ca8885cb680dd6c8c516e39..6ef8c62bd83395e5561e052a10f07bfa1773a2bf 100644
|
||||
--- a/templates/linux/after-install.tpl
|
||||
+++ b/templates/linux/after-install.tpl
|
||||
@@ -55,3 +55,10 @@ if apparmor_status --enabled > /dev/null 2>&1; then
|
||||
echo "Skipping the installation of the AppArmor profile as this version of AppArmor does not seem to support the bundled profile"
|
||||
fi
|
||||
fi
|
||||
+
|
||||
+# SIGNAL CHANGES BEGIN
|
||||
+
|
||||
+# Notify updater that the update was fully installed
|
||||
+touch '/opt/${sanitizedProductName}/.signal-postinst'
|
||||
+
|
||||
+# SIGNAL CHANGES END
|
||||
diff --git a/templates/nsis/include/installer.nsh b/templates/nsis/include/installer.nsh
|
||||
index 34e91dfe82fdbb2e929820f2e8deb771b7f7893c..73bfffc6c227a018cbbeb690d6d7b882ed142fc8 100644
|
||||
--- a/templates/nsis/include/installer.nsh
|
||||
|
|
29
pnpm-lock.yaml
generated
29
pnpm-lock.yaml
generated
|
@ -34,7 +34,7 @@ patchedDependencies:
|
|||
hash: e8a96f71e52bf903c9f1eadba4740489a0beb48da33db52354adca484fe1f495
|
||||
path: patches/@vitest+expect+2.0.5.patch
|
||||
app-builder-lib:
|
||||
hash: 04e067399341fd84f665a9752328485e134a017e78303896a4cc65aa9e4c0f89
|
||||
hash: 2a119a69a005842a6f7003c60ccd5e66c35900c65641c7930e514ae5e4c77982
|
||||
path: patches/app-builder-lib.patch
|
||||
backbone@1.6.0:
|
||||
hash: 342b4b6012f8aecfa041554256444cb25af75bc933cf2ab1e91c4f66a8e47a31
|
||||
|
@ -81,8 +81,8 @@ importers:
|
|||
.:
|
||||
dependencies:
|
||||
'@electron/asar':
|
||||
specifier: 3.3.1
|
||||
version: 3.3.1
|
||||
specifier: 3.4.1
|
||||
version: 3.4.1
|
||||
'@formatjs/fast-memoize':
|
||||
specifier: 2.2.3
|
||||
version: 2.2.3
|
||||
|
@ -1111,11 +1111,6 @@ packages:
|
|||
'@dual-bundle/import-meta-resolve@4.1.0':
|
||||
resolution: {integrity: sha512-+nxncfwHM5SgAtrVzgpzJOI1ol0PkumhVo469KCf9lUi21IGcY90G98VuHm9VRrUypmAzawAHO9bs6hqeADaVg==}
|
||||
|
||||
'@electron/asar@3.3.1':
|
||||
resolution: {integrity: sha512-WtpC/+34p0skWZiarRjLAyqaAX78DofhDxnREy/V5XHfu1XEXbFCSSMcDQ6hNCPJFaPy8/NnUgYuf9uiCkvKPg==}
|
||||
engines: {node: '>=10.12.0'}
|
||||
hasBin: true
|
||||
|
||||
'@electron/asar@3.4.1':
|
||||
resolution: {integrity: sha512-i4/rNPRS84t0vSRa2HorerGRXWyF4vThfHesw0dmcWHp+cspK743UanA0suA5Q5y8kzY2y6YKrvbIUn69BCAiA==}
|
||||
engines: {node: '>=10.12.0'}
|
||||
|
@ -9948,12 +9943,6 @@ snapshots:
|
|||
|
||||
'@dual-bundle/import-meta-resolve@4.1.0': {}
|
||||
|
||||
'@electron/asar@3.3.1':
|
||||
dependencies:
|
||||
commander: 5.1.0
|
||||
glob: 7.2.3
|
||||
minimatch: 3.1.2
|
||||
|
||||
'@electron/asar@3.4.1':
|
||||
dependencies:
|
||||
commander: 5.1.0
|
||||
|
@ -10058,7 +10047,7 @@ snapshots:
|
|||
|
||||
'@electron/universal@2.0.1':
|
||||
dependencies:
|
||||
'@electron/asar': 3.3.1
|
||||
'@electron/asar': 3.4.1
|
||||
'@malept/cross-spawn-promise': 2.0.0
|
||||
debug: 4.3.7(supports-color@8.1.1)
|
||||
dir-compare: 4.2.0
|
||||
|
@ -13340,7 +13329,7 @@ snapshots:
|
|||
|
||||
app-builder-bin@5.0.0-alpha.12: {}
|
||||
|
||||
app-builder-lib@26.0.14(patch_hash=04e067399341fd84f665a9752328485e134a017e78303896a4cc65aa9e4c0f89)(dmg-builder@26.0.14)(electron-builder-squirrel-windows@26.0.14):
|
||||
app-builder-lib@26.0.14(patch_hash=2a119a69a005842a6f7003c60ccd5e66c35900c65641c7930e514ae5e4c77982)(dmg-builder@26.0.14)(electron-builder-squirrel-windows@26.0.14):
|
||||
dependencies:
|
||||
'@develar/schema-utils': 2.6.5
|
||||
'@electron/asar': 3.4.1
|
||||
|
@ -14524,7 +14513,7 @@ snapshots:
|
|||
|
||||
dmg-builder@26.0.14(patch_hash=cb72ed47fa8d45513a36db33fcb41cb75c30cada4737da067bf3fa1f063725f2)(electron-builder-squirrel-windows@26.0.14):
|
||||
dependencies:
|
||||
app-builder-lib: 26.0.14(patch_hash=04e067399341fd84f665a9752328485e134a017e78303896a4cc65aa9e4c0f89)(dmg-builder@26.0.14)(electron-builder-squirrel-windows@26.0.14)
|
||||
app-builder-lib: 26.0.14(patch_hash=2a119a69a005842a6f7003c60ccd5e66c35900c65641c7930e514ae5e4c77982)(dmg-builder@26.0.14)(electron-builder-squirrel-windows@26.0.14)
|
||||
builder-util: 26.0.13
|
||||
builder-util-runtime: 9.3.2
|
||||
fs-extra: 10.1.0
|
||||
|
@ -14668,7 +14657,7 @@ snapshots:
|
|||
|
||||
electron-builder-squirrel-windows@26.0.14(dmg-builder@26.0.14):
|
||||
dependencies:
|
||||
app-builder-lib: 26.0.14(patch_hash=04e067399341fd84f665a9752328485e134a017e78303896a4cc65aa9e4c0f89)(dmg-builder@26.0.14)(electron-builder-squirrel-windows@26.0.14)
|
||||
app-builder-lib: 26.0.14(patch_hash=2a119a69a005842a6f7003c60ccd5e66c35900c65641c7930e514ae5e4c77982)(dmg-builder@26.0.14)(electron-builder-squirrel-windows@26.0.14)
|
||||
builder-util: 26.0.13
|
||||
electron-winstaller: 5.4.0
|
||||
transitivePeerDependencies:
|
||||
|
@ -14678,7 +14667,7 @@ snapshots:
|
|||
|
||||
electron-builder@26.0.14(electron-builder-squirrel-windows@26.0.14):
|
||||
dependencies:
|
||||
app-builder-lib: 26.0.14(patch_hash=04e067399341fd84f665a9752328485e134a017e78303896a4cc65aa9e4c0f89)(dmg-builder@26.0.14)(electron-builder-squirrel-windows@26.0.14)
|
||||
app-builder-lib: 26.0.14(patch_hash=2a119a69a005842a6f7003c60ccd5e66c35900c65641c7930e514ae5e4c77982)(dmg-builder@26.0.14)(electron-builder-squirrel-windows@26.0.14)
|
||||
builder-util: 26.0.13
|
||||
builder-util-runtime: 9.3.2
|
||||
chalk: 4.1.2
|
||||
|
@ -14722,7 +14711,7 @@ snapshots:
|
|||
|
||||
electron-winstaller@5.4.0:
|
||||
dependencies:
|
||||
'@electron/asar': 3.3.1
|
||||
'@electron/asar': 3.4.1
|
||||
debug: 4.3.7(supports-color@8.1.1)
|
||||
fs-extra: 7.0.1
|
||||
lodash: 4.17.21
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue