Launch external script

I have made my own application with electron, and I encounter an issue with production builds, when it comes to launching an external script.

When I run the code in the dev environment, I have something like:

spawnSync(PYTHON_LOCATION, args);

and it works well because PYTHON_LOCATION is public/ .

However, when I use electron-builder to make an AppImage, this does not work because the script can’t obviously be found. An AppImage application comes as a single file and it’s obvious that the public directory is not exported with it.

Is there a way to launch the python script directly within the AppImage? I mean how should I bundle the app to still have access to this python script and be able to execute it since an AppImage comes as a single file?

Is there a solution to this issue?


Hello, I do not understand exactly what the problem is. Can you upload an example AppImage for debugging? Thank you very much.

Someone alredy answered the question on Stackoverflow, but I did not test yet whether this solves my issue.

The original problem is that electron-builder packs everything in a single AppImage file, and thus the public directory (and files accessed by a relative path) do not exist anymore. I’ll keep you updated whether the stackoverflow answer makes sense or not.

Hopefully! An AppImage is always a single file, and contains everything your application needs to run. If it is more than a single file, then you are doing it wrong.