diff options
author | 0neGal <mail@0negal.com> | 2022-01-02 00:22:28 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-01-02 00:22:28 +0100 |
commit | 80eeab10e81a32c00c24608be83e7ea75ff9accf (patch) | |
tree | c12fe0163c16dead879e51f564f870fe8a7b980e /src/utils.js | |
parent | 67b32b527aec8d36a4b6cca14677febc46f0e26d (diff) | |
parent | 1598d8b3510580cd886c884b80a69c7b2bcfa422 (diff) | |
download | Viper-80eeab10e81a32c00c24608be83e7ea75ff9accf.tar.gz Viper-80eeab10e81a32c00c24608be83e7ea75ff9accf.zip |
Merge branch 'main' of 0neGal/viper into mod-support
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js index ba710dc..c89a033 100644 --- a/src/utils.js +++ b/src/utils.js @@ -18,6 +18,7 @@ process.chdir(app.getPath("appData")); var settings = { gamepath: "", lang: "en-US", + autoupdate: true, zip: "/northstar.zip", excludes: [ "ns_startup_args.txt", @@ -125,6 +126,21 @@ function update() { }) } +function updatevp(autoinstall) { + const { autoUpdater } = require("electron-updater"); + + if (autoinstall) { + autoUpdater.on("update-downloaded", (info) => { + autoUpdater.quitAndInstall(); + }); + } + + autoUpdater.on("error", (info) => {cli.exit(1)}); + autoUpdater.on("update-not-available", (info) => {cli.exit()}); + + autoUpdater.checkForUpdatesAndNotify(); +} + function launch(version) { if (process.platform == "linux") { console.error("error:", lang("cli.launch.linuxerror")) @@ -173,6 +189,7 @@ module.exports = { launch, update, setpath, + updatevp, settings, getNSVersion, setlang: (lang) => { |