aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-03-24 17:15:44 +0100
committer0neGal <mail@0negal.com>2022-03-24 17:15:44 +0100
commit63fb961c1a3b5df509ee96711b6d489b40efb330 (patch)
tree75a1b27c8357ff9a1a88d13f85e5d2d6c98fc092
parent9573c62bf1dfde501af4bd92854adc335faca68b (diff)
downloadViper-63fb961c1a3b5df509ee96711b6d489b40efb330.tar.gz
Viper-63fb961c1a3b5df509ee96711b6d489b40efb330.zip
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.
-rw-r--r--src/cli.js21
-rw-r--r--src/index.js8
-rw-r--r--src/lang/en.json1
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",