From 63fb961c1a3b5df509ee96711b6d489b40efb330 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Thu, 24 Mar 2022 17:15:44 +0100 Subject: added --no-vp-updates This overwrites viper.json and disables Viper updates, this is useful when repackaging Viper for other formats we don't already support. --- src/cli.js | 21 +++++++++++---------- src/index.js | 8 ++++++-- src/lang/en.json | 1 + 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/cli.js b/src/cli.js index cef2295..dd043c5 100644 --- a/src/cli.js +++ b/src/cli.js @@ -43,18 +43,19 @@ async function init() { // --help menu/argument if (cli.hasSwitch("help")) { console.log(`options: - --help ${lang("cli.help.help")} - --debug ${lang("cli.help.debug")} - --version ${lang("cli.help.version")} + --help ${lang("cli.help.help")} + --debug ${lang("cli.help.debug")} + --version ${lang("cli.help.version")} - --cli ${lang("cli.help.cli")} - --update ${lang("cli.help.update")} - --updatevp ${lang("cli.help.updatevp")} - --setpath ${lang("cli.help.setpath")} + --cli ${lang("cli.help.cli")} + --update ${lang("cli.help.update")} + --updatevp ${lang("cli.help.updatevp")} + --setpath ${lang("cli.help.setpath")} + --no-vp-updates ${lang("cli.help.novpupdates")} - --installmod ${lang("cli.help.installmod")} - --removemod ${lang("cli.help.removemod")} - --togglemod ${lang("cli.help.togglemod")}`) + --installmod ${lang("cli.help.installmod")} + --removemod ${lang("cli.help.removemod")} + --togglemod ${lang("cli.help.togglemod")}`) // In the future --setpath should be able to understand // relative paths, instead of just absolute ones. exit(); diff --git a/src/index.js b/src/index.js index 265e13d..752410e 100644 --- a/src/index.js +++ b/src/index.js @@ -56,7 +56,7 @@ function start() { ipcMain.on("savesettings", (event, obj) => {utils.saveSettings(obj)}) ipcMain.on("can-autoupdate", (event) => { - if (! require("electron-updater").autoUpdater.isUpdaterActive()) { + if (! require("electron-updater").autoUpdater.isUpdaterActive() || cli.hasParam("no-vp-updates")) { win.webContents.send("cant-autoupdate") } }) @@ -66,7 +66,11 @@ function start() { }); if (utils.settings.autoupdate) { - utils.updatevp(false) + if (cli.hasParam("no-vp-updates")) { + utils.handleNorthstarUpdating(); + } else { + utils.updatevp(false) + } } else { utils.handleNorthstarUpdating(); } diff --git a/src/lang/en.json b/src/lang/en.json index 47e18c0..04ecfdd 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -6,6 +6,7 @@ "cli.help.update": "updates Northstar from your set game path", "cli.help.setpath": "sets your game path", "cli.help.updatevp": "updates Viper itself, if supported.", + "cli.help.novpupdates": "overwrites viper.json and disables Viper updates", "cli.help.installmod": "installs a mod, folder or zip", "cli.help.removemod": "removes a mod", "cli.help.togglemod": "toggles a mod", -- cgit v1.2.3