I'm using the boilerplate from electron-forge to construct an electron app that I would like to package. The main window is wrapped in an additional "gate" window that I'm using as a license check.
in main.ts
, the relevant code:
const gateCreateWindowWithLicense = async (createWindow: any) => {
const path = require('path');
gateWindow = new BrowserWindow({
resizable: false,
frame: false,
width: 420,
height: 200,
webPreferences: {
preload: path.join(__dirname, '/gate.js'),
devTools: isDebug,
},
});
gateWindow.loadFile(`${__dirname}/gate.html`);
The structure of the project is:
-project\
--node_modules\
--src\
----render\
----main\
------gate.css\
------gate.html\
------gate.js\
------main.ts\
------preload.ts\
------menu.ts
When I package and attempt to run the app, it just loads a blank white screen that is the size of the gate window (but no other controls/features). When I launch the app locally via commandline (found inside /release/build):
(base) user@computer:~/project/release/build$ ./project.AppImage
(node:2740) electron: Failed to load URL: file:///tmp/.mount_EspritQdcf5k/resources/app/gate.html with error: ERR_FILE_NOT_FOUND
How do I make it so that all of the gate
files are moved in with the project? I've read about the "files" tag in project.json
but I dont know where the "to" directory is after its been packaged.