How to deploy an Electron app as an executable or installable in Windows?
You can package your program using electron-packager and then build a single setup EXE file using InnoSetup.
Since most answers dont have step by step instructions on packaging, let me post how i got to package the electron app.
We will be installing electron-packager first.
Electron Packager is a command line tool and Node.js library that bundles Electron-based application source code with a renamed Electron executable and supporting files into folders ready for distribution.
Install electron-packager :run following command in windows cmd
npm install -g electron-packager --save-dev
Next, lets package our app for windowsx64:
electron-packager appdirectory appName --platform=win32 --arch=x64 --electron-version=1.4.3
2020 UpdateYou can use electron-builder to create portable .exe file for your electron app. All you need to do is install electron-builder with yarn add electron-builder --dev
Then create a package.json file like this(this is just for portable .exe):
{ "name": "my-electron-app", "productName": "electron app", "version": "1.0.0", "description": "an electron app", "main": "main.js", "scripts": { "start": "electron .", "dist": "electron-builder" }, "devDependencies": { "electron": "^8.0.2", "electron-builder": "^22.3.2" }, "build": { "appId": "com.electron.app", "win": { "target": "portable" }, "portable": { "unicode": false, "artifactName": "my_electron_app.exe" } }}