From d21931a94c20bd37278986185433df60c495250a Mon Sep 17 00:00:00 2001 From: 0neGal Date: Wed, 29 Jun 2022 18:02:39 +0200 Subject: 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. --- src/utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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++) { -- cgit v1.2.3