diff --git a/modules/geth.js b/modules/geth.js index 7653f27..33b992a 100644 --- a/modules/geth.js +++ b/modules/geth.js @@ -8,6 +8,12 @@ class Geth { constructor() { this.gethProcess = null; this.logStream = fs.createWriteStream(path.join(app.getPath('userData'), 'gethlog.txt')); + + if (appRoot.path.indexOf('app.asar') > -1) { + this.rootPath = path.dirname(appRoot.path); + } else { + this.rootPath = appRoot.path; + } } _writeLog(text) { @@ -17,7 +23,7 @@ class Geth { startGeth() { // get the path of get and execute the child process try { - const gethPath = path.join(path.join(appRoot.path, 'bin'), 'geth'); + const gethPath = path.join(path.join(this.rootPath, 'bin'), 'geth'); this.gethProcess = child_process.spawn(gethPath, ['--ws', '--wsorigins', '*', '--wsaddr', '127.0.0.1', '--wsport', '8546', '--wsapi', 'admin,db,eth,net,miner,personal,web3']); this.gethProcess.on('error', function(err) { dialog.showErrorBox("Error starting application", "Geth failed to start!"); @@ -36,7 +42,7 @@ class Geth { } stopGeth() { - const gethWrapePath = path.join(path.join(appRoot.path, 'bin'), 'WrapGeth.exe'); + const gethWrapePath = path.join(path.join(this.rootPath, 'bin'), 'WrapGeth.exe'); child_process.spawnSync(gethWrapePath, [this.gethProcess.pid]); } } diff --git a/package.json b/package.json index f62833d..ea23cf0 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,10 @@ "appId": "Ether1DesktopWallet", "win": { "icon": "build/icon.png", - "target": "7z" + "target": "7z", + "extraResources": [ + "bin/*" + ] } }, "repository": "https://github.com/taeguscromis/Ether1DesktopWallet", @@ -29,7 +32,7 @@ "app-root-path": "^2.1.0", "electron-storage": "^1.0.7", "handlebars": "^4.0.12", - "nedb": "^1.8.0", + "nedb": "^1.8.0" }, "devDependencies": { "electron": "^3.0.12",