diff options
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/utils.js b/src/utils.js index b4ff04d..06acbdf 100644 --- a/src/utils.js +++ b/src/utils.js @@ -52,8 +52,8 @@ function saveSettings() { fs.writeFileSync(app.getPath("appData") + "/viper.json", JSON.stringify(settings)); } -function getInstalledVersion() { - const versionFilePath = path.join(settings.gamepath, "ns_version.txt"); +function getNSVersion() { + var versionFilePath = path.join(settings.gamepath, "ns_version.txt"); if (fs.existsSync(versionFilePath)) { return fs.readFileSync(versionFilePath, "utf8"); @@ -73,7 +73,7 @@ function update() { ipcMain.emit("ns-updating"); console.log(lang("cli.update.checking")); - const version = getInstalledVersion(); + var version = getNSVersion(); request({ json: true, @@ -106,6 +106,7 @@ function update() { fs.createReadStream(settings.zip).pipe(unzip.Extract({path: settings.gamepath})) .on("finish", () => { fs.writeFileSync(path.join(settings.gamepath, "ns_version.txt"), tag); + ipcMain.emit("getversion"); for (let i = 0; i < settings.excludes.length; i++) { let exclude = path.join(settings.gamepath + "/" + settings.excludes[i]); @@ -153,6 +154,7 @@ module.exports = { update, setpath, settings, + getNSVersion, setlang: (lang) => { settings.lang = lang; saveSettings(); |