The Big Boy Installer Solution 💪 For when your Electron App exceeds the puny 2GB maximum size of normal windows installers - Pushes the theoretical max to 8EB!
At it's core, this is pretty much a mirror of sourceforge project NSISBI a build tool for creating windows installers >2Gib. This repo also provides supplemental nicities for sane compatability with Electron-Builder's windows-flavored build pipeline.
In your Electron-Builder setup, simply configure customNsisBinary to enable creation of windows installers larger than 2GiB:
{
// Your config
// ...
"build": {
"nsis": {
"customNsisBinary": {
"url":"https://github.com/SoundSafari/NSISBI-ElectronBuilder/releases/download/1.0.0/nsisbi-electronbuilder-3.10.3.7z",
"checksum":"WRmZUsACjIc2s7bvsFGFRofK31hfS7riPlcfI1V9uFB2Q8s7tidgI/9U16+X0I9X2ZhNxi8N7Z3gKvm6ojvLvg=="
}
}
}
}
🚨 You must have wine installed on your machine in order to build for windows on a MacOS/Linux environment.
- 🍎 MacOS [Brew]
brew install --cask --no-quarantine wine-stable
- 🐧 Linux [Debian]
sudo apt install wine wine32 libwine fonts-wine
- 🐧 Linux [Arch]
sudo pacman -S wine
The decade old version of NSIS that ships with electron builder by default has native compiled MacOS/Linux NSIS binaries.
NSISBI and pretty much all recent releases of NSIS do not ship cross-platform binaries. It is much easier and reliable to persue cross-platform builds via wine.
We put shell-scripts in the binary-target paths Electron-Builder uses for NSIS on Mac/Linux. The scripts invoke
wine
to execute our NSISBI flavored./Bin/makensis.exe
and wine-ify all the local file paths transmitted to the process.This uses the wine installed on the machine you're building with
which wine
and not any static-versions of wine packaged with electron-builder.
If your final installer.exe size exceeds 4GB, NSISBI generates a two-file installer:
- 1️⃣ < Small installer.exe file >
- 2️⃣ < Large data-file with your app data >
Both files will appear in your normal electron-builder output directory. To distribute your two file installer simply .zip
both files together and distribute the .zip
file.
The two files must remain in the same directory in order for the installer to work.
While NSISBI is capable of producing windows
.exe
installers all the way up to 8EB, it must produce a two-file installer after 4Gib is exceeded. The NSISBI author goes into more detail on this topic if you're interested.
- NSISBI Author @JasonFriday13 [SourceForge]
- Electron-Builder [GitHub]
Electron-Builder has a pretty interesting escape hatch for using custom NSIS binaries in your build, namely you must provide :
- A remote URL for your custom NSIS binary inside a 7zip archive.
- A base64 encoded sha512 checksum of the the aforementioned .7z archive
7z a -r nsisbi-electronbuilder-VERSION.7z *
cat ./nsisbi-electronbuilder-VERSION.7z | openssl dgst -sha512 -binary | base64
# NOTE: To use with electron-builder:
# -> You must host .7z at a remote URL
# -> You must include sha512 checksum in your electron-builder config
Is the NSISBI version out of date? Found a Bug? Want more features? Open an issue or PR!
Sheparded with ❤️ by the Electron-Builder community