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
As none of the methods above worked and I don't want to use an external lib for this, i tried following:
if (!fs.existsSync("../images")) {
fs.mkdirSync("./../images");
}
return path.resolve("./../images/") + "/";
You can use any directory that should exist at the top level or anywhere else. In my case I know that one level higher in the directory there must be a directory called "images".
This solution worked in my case for DEV build and prod (packaged).
Are there any drawbacks when using this approach?