Traditional Way Of Distribution Has Problems
Usual way to distribute an Electron Application is to provide a lot of files: application's sources (scripts, assets and other resources), and electron binaries.
Look at the typical set of files (yeah, there are a LOT of files):
(This directory should be copied to user computer)
├───file-explorer <-- contains electron application files
│ │ about.html
│ │ index.html
│ │ main.js
│ │ package.json
│ │ README.md
│ │ script.js
│ │ style.css
│ │ ...
│ │ │ address_bar.js
│ │ │ folder_view.js
│ │ │ mime.js
│ │ │ underscore.js
The standard approach has several obvious issues:
- It's impossible to create a single executable file of an electron application.
- Application source code are available for anyone.
- No ways to protect application assets (scripts, images and others).
- No ways to set executable file icon.
- No ways to add a splashscreen.
BoxedApp Packer can pack all the files into a single executable file (packed exe). Being run, a packed exe doesn't unpack embedded files on the disk. They are in memory.
Pack The Files
Download BoxedApp Packer and run it. Select electron.exe as input exe, and set output exe path as you want (you can change the output name).
As you know, one needs to pass folder name of the electron app to electron.exe to run it:
> electron.exe file-explorer
That's why you should also click to "Override command line" and type there:
It means then when someone runs the output exe, it runs as if "file-explorer" is passed as an argument.
Click to Application Directory, then click to Add Files..., select all electron binaries (except electron.exe) and add them.
Then click to Import Directory... and firstly select "file-explorer", then "locales" and finally "resources".
Build it and run. It works!