diff options
-rw-r--r-- | src/index.js | 8 | ||||
-rw-r--r-- | src/utils.js | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/index.js b/src/index.js index fa2a35f..0e8364f 100644 --- a/src/index.js +++ b/src/index.js @@ -59,7 +59,13 @@ function start() { win.webContents.send("mods", utils.mods.list()); }); - if (utils.settings.autoupdate) {utils.updatevp(false)} + if (utils.settings.autoupdate) { + utils.updatevp(false) + } else { + if (utils.settings.nsupdate) { + utils.update(); + } + } autoUpdater.on("update-downloaded", () => { win.webContents.send("updateavailable") 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(); |