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

View file

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