electron-builder is a powerful tool for building and packaging Electron applications. It streamlines the setup process for developers looking to create and automate the distribution of their apps.
$ npx skills add https://github.com/pedronauck/skills --skill electron-builderelectron-builder is a complete solution for packaging and building Electron applications ready for distribution across macOS, Windows, and Linux. It handles native dependency compilation, code signing on CI servers or local machines, and includes auto-update support out of the box. The tool supports numerous target formats including dmg and pkg for macOS, AppImage and snap for Linux, and nsis, MSI, and portable executables for Windows. It also manages publishing artifacts to GitHub Releases, Amazon S3, DigitalOcean Spaces, and other services. Developers benefit from automatic tool downloading, parallel building and publishing, and Docker support for cross-platform builds without manual setup.
Install using pnpm or npx commands as detailed.
Package Electron applications for production
Set up auto-updates for apps
Integrate with CI/CD workflows
$ npx skills add https://github.com/pedronauck/skills --skill electron-buildergit clone https://github.com/electron-userland/electron-builderCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Act as an expert in [COMPANY]'s Electron application development. Use electron-builder to create a production-ready installer for a cross-platform desktop app targeting [INDUSTRY]. The app's main executable is located at [APP_PATH]. Include automatic updates, code signing with a certificate from [CERTIFICATE_NAME], and support for Windows, macOS, and Linux. Generate the electron-builder configuration file and explain the build process step-by-step.
# Electron App Packaging with electron-builder
Here's a production-ready configuration for your [COMPANY] desktop application in the [INDUSTRY] sector:
## Configuration File (`electron-builder.json`)
```json
{
"appId": "com.company.app",
"productName": "Company App",
"copyright": "© 2024 Company Name",
"directories": {
"output": "dist"
},
"files": ["**/*", {
"from": "build",
"filter": ["**/*"]
}],
"win": {
"target": ["nsis", "zip"],
"certificateFile": "certificates/cert.p12",
"signingHashAlgorithms": ["sha256"]
},
"mac": {
"target": ["dmg", "zip"],
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "entitlements.mac.plist",
"entitlementsInherit": "entitlements.mac.plist"
},
"linux": {
"target": ["AppImage", "deb", "rpm"],
"category": "Utility"
},
"publish": {
"provider": "generic",
"url": "https://updates.company.com/app"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true
}
}
```
## Build Process
1. **Prepare your app**: Ensure your main executable is at `src/app.js` and build artifacts are in `build/`
2. **Install dependencies**:
```bash
npm install electron-builder --save-dev
```
3. **Add entitlements** (macOS): Create `entitlements.mac.plist` with:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>
```
4. **Build your app**:
```bash
npm run build
electron-builder --win --mac --linux
```
5. **Verify artifacts**: Check the `dist/` folder for:
- Windows: `Company App Setup 1.0.0.exe`, `Company App 1.0.0.zip`
- macOS: `Company App-1.0.0.dmg`, `Company App-1.0.0.zip`
- Linux: `company-app_1.0.0_amd64.AppImage`, `company-app_1.0.0.deb`
## Next Steps
- Upload packages to your update server at `https://updates.company.com/app`
- Configure the update server to serve these files with proper versioning
- Test the installers on clean machines for each platform
- Consider adding auto-updater code to your app:
```javascript
const { autoUpdater } = require("electron-updater");
autoUpdater.checkForUpdatesAndNotify();
```Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan