1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-22 16:29:09 +01:00

[PM-7280] Check command args for disabled updater (#8613)

* dont autoupdate on older OS and with args

* remove os release checking

* use dashes
This commit is contained in:
Kyle Spearrin 2024-04-11 14:14:56 -04:00 committed by GitHub
parent 787ad64b73
commit 59392418d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,8 +27,7 @@ export class UpdaterMain {
process.platform === "win32" && !isWindowsStore() && !isWindowsPortable();
const macCanUpdate = process.platform === "darwin" && !isMacAppStore();
this.canUpdate =
process.env.ELECTRON_NO_UPDATER !== "1" &&
(linuxCanUpdate || windowsCanUpdate || macCanUpdate);
!this.userDisabledUpdates() && (linuxCanUpdate || windowsCanUpdate || macCanUpdate);
}
async init() {
@ -144,4 +143,13 @@ export class UpdaterMain {
autoUpdater.autoDownload = true;
this.doingUpdateCheck = false;
}
private userDisabledUpdates(): boolean {
for (const arg of process.argv) {
if (arg != null && arg.toUpperCase().indexOf("--ELECTRON_NO_UPDATER=1") > -1) {
return true;
}
}
return process.env.ELECTRON_NO_UPDATER === "1";
}
}