Lesson 16 of 28
javascriptCreating Installers – NSIS (Windows), DMG (macOS), AppImage (Linux)
10 mins
Course progress57%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 16 of 28
javascript10 mins
Keep these ideas in mind as you work through the lesson.
electron-builder uses NSIS under the hood. You can customise the installer via the nsis object in package.json:
"nsis": {
"oneClick": false,
"perMachine": true,
"allowToChangeInstallationDirectory": true,
"include": "build/installer.nsh"
}
A custom NSIS script (installer.nsh) can add extra steps (e.g., install a service).
electron-builder creates a DMG that displays a drag‑to‑Applications window.
You can tweak the appearance:
"dmg": {
"icon": "build/icon.icns",
"background": "build/dmg-bg.png",
"contents": [
{ "x": 130, "y": 220 },
{ "x": 410, "y": 220, "type": "link", "path": "/Applications" }
]
}
electron-builder bundles everything into a self‑extracting AppImage.
Add Linux specific config if you need desktop icons:
"linux": {
"target": "AppImage",
"category": "Utility",
"icon": "build/icon.png"
}
Run npm run build and you’ll find MyApp-Setup.exe, MyApp.dmg, and MyApp.AppImage in the dist/ folder.