Fix boolean treatment in updater

This commit is contained in:
Fedor Indutny 2023-12-13 18:20:58 +01:00 committed by GitHub
parent e3efb48960
commit 02468d8a56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 10 deletions

View file

@ -356,9 +356,7 @@
"mergeASARs": true, "mergeASARs": true,
"releaseInfo": { "releaseInfo": {
"vendor": { "vendor": {
"minOSVersion": "19.0.0", "minOSVersion": "19.0.0"
"requireManualUpdate": false,
"requireUserConfirmation": false
} }
}, },
"singleArchFiles": "node_modules/@signalapp/{libsignal-client/prebuilds/**,ringrtc/build/**}", "singleArchFiles": "node_modules/@signalapp/{libsignal-client/prebuilds/**,ringrtc/build/**}",
@ -399,9 +397,7 @@
], ],
"releaseInfo": { "releaseInfo": {
"vendor": { "vendor": {
"minOSVersion": "10.0.10240", "minOSVersion": "10.0.10240"
"requireManualUpdate": false,
"requireUserConfirmation": false
} }
}, },
"signDlls": true, "signDlls": true,

View file

@ -50,8 +50,8 @@ const INTERVAL = 30 * durations.MINUTE;
type JSONVendorSchema = { type JSONVendorSchema = {
minOSVersion?: string; minOSVersion?: string;
requireManualUpdate?: boolean; requireManualUpdate?: 'true' | 'false';
requireUserConfirmation?: boolean; requireUserConfirmation?: 'true' | 'false';
}; };
type JSONUpdateSchema = { type JSONUpdateSchema = {
@ -285,7 +285,8 @@ export abstract class Updater {
await this.installUpdate( await this.installUpdate(
updateFilePath, updateFilePath,
!updateInfo.vendor?.requireUserConfirmation && this.canRunSilently() updateInfo.vendor?.requireUserConfirmation !== 'true' &&
this.canRunSilently()
); );
const mainWindow = this.getMainWindow(); const mainWindow = this.getMainWindow();
@ -402,7 +403,7 @@ export abstract class Updater {
const { vendor } = parsedYaml; const { vendor } = parsedYaml;
if (vendor) { if (vendor) {
if (vendor.requireManualUpdate) { if (vendor.requireManualUpdate === 'true') {
this.logger.warn('checkForUpdates: manual update required'); this.logger.warn('checkForUpdates: manual update required');
this.markCannotUpdate( this.markCannotUpdate(
new Error('yaml file has requireManualUpdate flag'), new Error('yaml file has requireManualUpdate flag'),