Skip to content

Commit 55de25e

Browse files
committed
Fixed Auto Updater
1 parent 0b8c4e3 commit 55de25e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simplelauncher",
3-
"version": "0.1.7",
3+
"version": "0.1.8",
44
"description": "Launcher for SimpleClient",
55
"main": "src/main.js",
66
"scripts": {
@@ -19,6 +19,7 @@
1919
},
2020
"homepage": "https://simpleclient.github.io",
2121
"dependencies": {
22+
"app-root-path": "^3.1.0",
2223
"child_process": "^1.0.2",
2324
"dialog-node": "^0.2.1",
2425
"electron-is-dev": "^2.0.0",

src/updater.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
const { platform } = require("os")
22
const { join } = require("path")
3-
const { env } = require("process")
43
const { getDirectory } = require("./util")
5-
const { execFile, spawnSync, spawn } = require("child_process")
6-
const { existsSync, mkdirSync } = require("fs")
4+
const { execFile, spawnSync } = require("child_process")
5+
const { existsSync, mkdirSync, readFileSync } = require("fs")
6+
const { path } = require("app-root-path")
77

88
const repository = 'FabiPunktExe/SimpleLauncher'
99

1010
const log = (...data) => console.log('[Updater] ' + data)
1111

1212
function getLocalVersion() {
13-
return env.npm_package_version
13+
const file = join(path, 'package.json')
14+
return JSON.parse(readFileSync(file)).version;
1415
}
1516

1617
async function getRemoteVersion() {

0 commit comments

Comments
 (0)