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:
parent
787ad64b73
commit
59392418d1
@ -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";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user