diff options
author | 0neGal <mail@0negal.com> | 2022-02-23 18:33:59 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-02-23 18:44:27 +0100 |
commit | 5193485b5c66170330b920d891e3fe1442cc1f3d (patch) | |
tree | f1a64a3fccc64774d527165fc5d6c68d4cf5d4f6 /src/utils.js | |
parent | 70309583c81622ff5f5d41e2a9b85df287792326 (diff) | |
download | Viper-5193485b5c66170330b920d891e3fe1442cc1f3d.tar.gz Viper-5193485b5c66170330b920d891e3fe1442cc1f3d.zip |
implement ability to disable NS auto-updates
Albeit with some caveats, due to the way electron-updater is setup, if
you're not on a version of Viper which supports auto-updates the event
which runs the NS Updater code will never be run, and hence it'll never
auto-update. This was also an issue before, but I only noticed it now.
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/utils.js b/src/utils.js index 2449a73..655eee0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -75,7 +75,7 @@ async function isGameRunning() { // // It uses isGameRunning() to ensure it doesn't run while the game is // running, as that may have all kinds of issues. -function handleNorthstarAutoUpdating() { +function handleNorthstarUpdating() { if (!settings.autoupdate || !fs.existsSync("viper.json") || settings.gamepath.length === 0) { return; } @@ -314,8 +314,11 @@ function updatevp(autoinstall) { autoUpdater.on("error", (info) => {cli.exit(1)}); autoUpdater.on("update-not-available", (info) => { - // only check for N* updates if Viper itself has no updates - handleNorthstarAutoUpdating(); + // only check for NS updates if Viper itself has no updates and + // if NS auto updates is enabled. + if (settings.nsupdate || cli.hasArgs()) { + handleNorthstarUpdating(); + } cli.exit(); }); @@ -767,6 +770,7 @@ module.exports = { getNSVersion, getTF2Version, isGameRunning, + handleNorthstarUpdating, setlang: (lang) => { settings.lang = lang; saveSettings(); |