diff options
author | 0neGal <mail@0negal.com> | 2022-06-29 18:02:39 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-06-29 18:02:39 +0200 |
commit | d21931a94c20bd37278986185433df60c495250a (patch) | |
tree | 291c46f467bea3ac6095082b119f8ed44ce7aa64 | |
parent | 83361f13bbc656faca99ba21f6394d7072c2fa63 (diff) | |
download | Viper-d21931a94c20bd37278986185433df60c495250a.tar.gz Viper-d21931a94c20bd37278986185433df60c495250a.zip |
require NorthstarLauncher.exe to be found
Now, even if the core mods are installed it'll still make sure the
NorthstarLauncher.exe exists, so if Northstar has only been half
installed it'll be detected.
-rw-r--r-- | src/utils.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js index 7139706..a47bff1 100644 --- a/src/utils.js +++ b/src/utils.js @@ -220,6 +220,12 @@ function saveSettings(obj = {}) { // Returns the current Northstar version // If not installed it'll return "unknown" function getNSVersion() { + // if NorthstarLauncher.exe doesn't exist, always return "unknown" + if (! fs.existsSync(path.join(settings.gamepath, "NorthstarLauncher.exe"))) { + return "unknown"; + } + + // mods to check version of var versionFiles = [ "Northstar.Client", "Northstar.Custom", @@ -233,6 +239,7 @@ function getNSVersion() { versions.push(version) } + // checks version of mods for (let i = 0; i < versionFiles.length; i++) { var versionFile = path.join(settings.gamepath, "R2Northstar/mods/", versionFiles[i],"/mod.json"); if (fs.existsSync(versionFile)) { @@ -252,6 +259,7 @@ function getNSVersion() { if (versions.includes("unknown")) {return "unknown"} + // verifies all mods have the same version number let mismatch = false; let baseVersion = versions[0]; for (let i = 0; i < versions.length; i++) { |