Package Electron Script
The project provides a helper javascript script to help package the electron project.
<root>
└─ electron
└─ scripts
└─ package-electron.js
Usage
Flags:
--mac: Build targeting macosappformat. Default is targeting windows.--sing: VMP sing the packages for Widevine DRM. Requirespythonand signup on EVS. Check details.--appx: Bundle application as APPX format. Cannot be used with--mac.--msix: Bundle application as MSIX format.
Environment variables
WINDOWSSDKDIR: Path to the windows kit when installed in a different location than the expected.WINDOWS_CERTIFICATE: Path to the certificate.pfx file.WINDOWS_CERTPASS: Password for the certificate. It can be left blank if no password is needed.
note
If the environment variables are not provided, the script will attempt to use known default values. This is useful only for development.
Samples
Create simple bundles for windows (exe)
node scripts/package-electron.js
Create app bundles for macos
node scripts/package-electron.js --mac
Create appx bundles for Microsoft Store
node scripts/package-electron.js --appx
Create signed builds for widevine
node scripts/package-electron.js --sign
Create msix bundles for Microsoft Store
node scripts/package-electron.js --msix
info
You can combine --sing with --appx or --mac.
Sign is only required if you need to play DRM content. Otherwise it can be omited.
Dependencies
@electron/packagerelectron-windows-storepython3