Launching code from appData directory


#1

Hey all,

I have a requirement that says releases have to be downloaded and verified prior to launching it. So I’m saving the downloading the latest release and saving it to userData directory and do this:

let releasePath =  app.getPath('userData') + '/' + currentVersion + '/app/index.html';
win.loadURL(`file://${releasePath}`);

This works fine during development but, not in production mode. When I try and launch it in production mode it gives me this error:

Failed to compile /home/evan/.config/test-app/10/app/app.asar/index.html: Asked for /home/evan/.config/test-app/10/app/app.asar/index.html but it was not precompiled!

I’ve looked at electron-compile but, I have no clue what to do with the .cache directory.

If anybody has a solution to this then that would be great.