Notes from a small Laptop…
Finding instructions for packaging election apps turned out to lead me, moment by moment, inexorably through the madness that is youtube. So, here is my typed version of Things That I Did, picked up from youtube and https://ourcodeworld.com/articles/read/365/how-to-create-a-windows-installer-for-an-application-built-with-electron-framework .
First of all, I moved all electron-based folders into an electron workspace. Into that workspace I hit
npm install electron-winstaller.
npm install electron-squirrel-startup
and wait a bit. Now is a good time for a cup of tea. Frankly any time is a good time for a cup of tea, but during downloads and installation you should be stretching your legs anyhow.
Now we alter the main.js file to handle events from squirrel.
After the const app module to control application life, we add some code snippets from ourcodeworld.
Then we find a link to electron-packager, and then we cry.
npm install electron-packager -g // The -g switch gives us a global install
We roll back npm 5.3.0 to 5.2.0 because otherwise the build breaks.
npm i -g email@example.com // On my ARCH installation I tried out 5.4 instead. Results as yet unknown.
We add a script to package.json and we run it, and it works, and we launch the app, and it dies.