* all binaries are now in the app folder

This commit is contained in:
Taegus
2018-12-22 10:58:59 +01:00
parent 0d98b8a03d
commit 3af97f81ba
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
const child_process = require('child_process'); const child_process = require('child_process');
const {app, dialog} = require('electron'); const {app, dialog} = require('electron');
const appRoot = require('app-root-path');
const path = require('path'); const path = require('path');
const fs = require('fs'); const fs = require('fs');
@@ -16,7 +17,7 @@ class Geth {
startGeth() { startGeth() {
// get the path of get and execute the child process // get the path of get and execute the child process
try { try {
const gethPath = path.join(app.getPath('userData'), 'geth'); const gethPath = path.join(path.join(appRoot.path, '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 = 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) { this.gethProcess.on('error', function(err) {
dialog.showErrorBox("Error starting application", "Geth failed to start!"); dialog.showErrorBox("Error starting application", "Geth failed to start!");
@@ -35,7 +36,7 @@ class Geth {
} }
stopGeth() { stopGeth() {
const gethWrapePath = path.join(app.getPath('userData'), 'WrapGeth.exe'); const gethWrapePath = path.join(path.join(appRoot.path, 'bin'), 'WrapGeth.exe');
child_process.spawnSync(gethWrapePath, [this.gethProcess.pid]); child_process.spawnSync(gethWrapePath, [this.gethProcess.pid]);
} }
} }

View File

@@ -26,10 +26,10 @@
"license": "CC0-1.0", "license": "CC0-1.0",
"dependencies": { "dependencies": {
"adm-zip": "^0.4.13", "adm-zip": "^0.4.13",
"app-root-path": "^2.1.0",
"electron-storage": "^1.0.7", "electron-storage": "^1.0.7",
"handlebars": "^4.0.12", "handlebars": "^4.0.12",
"nedb": "^1.8.0", "nedb": "^1.8.0",
"typescript": "^3.2.2"
}, },
"devDependencies": { "devDependencies": {
"electron": "^3.0.12", "electron": "^3.0.12",