diff --git a/TrimSPelec.js b/TrimSPelec.js index 3aef0be..fd0ccef 100644 --- a/TrimSPelec.js +++ b/TrimSPelec.js @@ -54,3 +54,10 @@ function readAsciiFile(filename) { return(content); } +function appPath() { + // return the path where the app resides +// let path = require('app').getAppPath(); + // console.log(path); + let path = "./"; + return path; +} diff --git a/TrimSPlib.js b/TrimSPlib.js index 57258f4..9aca736 100644 --- a/TrimSPlib.js +++ b/TrimSPlib.js @@ -994,7 +994,8 @@ function startSequence(All) { // Use Linux version Progress=Progress+90/SValues.length; // Update GUI progress bar - cmd = "cd "+All["workPath"]+";cp "+FILENAME+".inp eingabe1.inp; ./trimspNL"; // Or use $ENV{'TRIMBIN'}; + let path = process.env.PWD; + cmd = "cd "+All["workPath"]+";cp "+FILENAME+".inp eingabe1.inp;"+path+"/trimspNL"; // Or use $ENV{'TRIMBIN'}; // document.getElementById("myBar").style.width = Progress + "%"; // document.getElementById("myBar").innerHTML = Progress + "%"; // Execute command @@ -1044,7 +1045,8 @@ function startSequence(All) { writeAsciiFile(FILENAME+".inp", eingabe1); Progress=20; // Update progress on GUI - cmd = "cd "+All["workPath"]+";cp "+FILENAME+".inp eingabe1.inp; ./trimspNL"; // Or use $ENV{'TRIMBIN'}; + let path = process.env.PWD; + cmd = "cd "+All["workPath"]+";cp "+FILENAME+".inp eingabe1.inp;"+path+"/trimspNL"; // Or use $ENV{'TRIMBIN'}; execute(cmd); // document.getElementById("myBar").style.width = Progress + "%"; // document.getElementById("myBar").innerHTML = Progress + "%"; diff --git a/main.js b/main.js index d2e33f8..e678437 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,4 @@ -const { app, BrowserWindow, Menu, dialog, ipcMain, fs } = require('electron') +const { app, BrowserWindow, Menu, dialog, ipcMain, fs } = require('electron'); function createWindow () { const win = new BrowserWindow({ @@ -205,6 +205,7 @@ function createWindow () { } app.whenReady().then(createWindow) +console.log(app.getAppPath()); app.on('window-all-closed', () => { if (process.platform !== 'darwin') {