mirror of
https://github.com/bitwarden/browser
synced 2025-01-21 16:58:31 +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:
parent
787ad64b73
commit
59392418d1
@ -27,8 +27,7 @@ export class UpdaterMain {
|
|||||||
process.platform === "win32" && !isWindowsStore() && !isWindowsPortable();
|
process.platform === "win32" && !isWindowsStore() && !isWindowsPortable();
|
||||||
const macCanUpdate = process.platform === "darwin" && !isMacAppStore();
|
const macCanUpdate = process.platform === "darwin" && !isMacAppStore();
|
||||||
this.canUpdate =
|
this.canUpdate =
|
||||||
process.env.ELECTRON_NO_UPDATER !== "1" &&
|
!this.userDisabledUpdates() && (linuxCanUpdate || windowsCanUpdate || macCanUpdate);
|
||||||
(linuxCanUpdate || windowsCanUpdate || macCanUpdate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
@ -144,4 +143,13 @@ export class UpdaterMain {
|
|||||||
autoUpdater.autoDownload = true;
|
autoUpdater.autoDownload = true;
|
||||||
this.doingUpdateCheck = false;
|
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";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user