I have an Portable Electron App (packed with: electron-builder + asar, portable build) on Windows. I try to get the application path but it returns a path within the user\\t
From the main process:
// If not already defined...
const { app } = require ('electron');
const path = require ('path');
let execPath;
execPath = path.dirname (app.getPath ('exe'));
// or
execPath = path.dirname (process.execPath);
From a renderer process:
// If not already defined...
const { remote } = require ('electron');
const path = require ('path');
let execPath;
execPath = path.dirname (remote.app.getPath ('exe'));
// or
execPath = path.dirname (remote.process.execPath);