Overview
MQTT Explorer uses electron-builder to create platform-specific installers and packages. The packaging system supports multiple formats per platform and handles code signing, notarization, and store submissions.Package Configuration
Packaging is configured inpackage.json under the build key and orchestrated by package.ts:
package.json
Build Preparation
Before packaging, create a clean build environment:Prepare release build
- Creates a fresh clone in
build/clean/ - Installs dependencies with frozen lockfile
- Builds the application
- Installs only production dependencies
- Removes
app/node_modulesto reduce package size
The
prepare-release script ensures a clean, reproducible build by cloning from the local git repository.Platform Packaging
Thepackage.ts script handles multi-format packaging for each platform.
Windows Packages
Create Windows installers:Portable Executable
Portable Executable
Format: No installation required - runs directly.
.exe portable applicationArchitecture: x64Configuration:NSIS Installer
NSIS Installer
Format:
.exe installerArchitecture: x64Features:- Desktop shortcut creation
- Start menu integration
- Uninstaller included
- Auto-update support
macOS Packages
Create macOS disk images:DMG Installer
DMG Installer
Format: Entitlements:
.dmg disk imageArchitectures:- x64 (Intel)
- arm64 (Apple Silicon)
res/entitlements.mac.plist- Parent appres/entitlements.mac.inherit.plist- Child processes
Mac App Store
Mac App Store
Format:
.pkg for App Store submissionEntitlements: res/entitlements.mas.plistSandboxing: Full App Store sandbox restrictionsProvisioning Profile: res/MQTT_Explorer_Store_Distribution_Profile.provisionprofileLinux Packages
Create Linux packages:AppImage
AppImage
Format: Features:
.AppImage portable applicationArchitectures:- x64
- armv7l (32-bit ARM)
- arm64 (64-bit ARM)
- Single file, no installation
- Runs with
--no-sandboxflag (seeafterPack.ts) - Desktop integration on first run
Snap Package
Snap Package
Format:
.snap packageArchitecture: x64 onlyStore: Published to Snapcraft StoreConfiguration:Snap builds for ARM architectures are not supported on x64 build machines.
Debian Package
Debian Package
Format: Compatible with: Debian, Ubuntu, Linux Mint, Pop!_OS
.deb packageArchitectures: x64, armv7l, arm64Package Metadata:Windows Store Package
Create Microsoft Store package:.appx application package
Configuration:
Docker Packaging
Browser mode can be packaged as a Docker container.Multi-Platform Docker Build
The GitHub Actions workflow builds for multiple architectures:Docker Image Features
- Base: Alpine Linux with Node.js 24
- Size: ~200MB final image
- User: Non-root (UID 1001)
- Health Check: Built-in endpoint
- Signal Handling: dumb-init for proper process management
- Persistent Data:
/app/datavolume
Post-Build Scripts
afterPack Hook
Runs after each platform package is created (scripts/afterPack.ts):
afterSign Hook
Runs after macOS code signing (scripts/notarize.ts):
Package Output
Packages are created in thebuild/ directory:
Publishing Packages
Packages are automatically published when built in CI/CD:GH_TOKEN environment variable
Snapcraft Store: Requires SNAPCRAFT_STORE_CREDENTIALS secret
Testing Packages Locally
Before CI/CD, test packages locally:Troubleshooting
Package Build Fails
Missing dependencies
Missing dependencies
Code signing issues (macOS)
Code signing issues (macOS)
Verify certificates are installed:Check environment variables:
Snapcraft authentication
Snapcraft authentication
Out of disk space
Out of disk space
Clean build artifacts:
Package Won’t Install
macOS: “App is damaged and can’t be opened”- Notarization failed or wasn’t performed
- See Notarization
- Expected for unsigned or new publishers
- Code signing certificate reduces warnings
Next Steps
Releases
Automate the release process with semantic versioning
Notarization
Set up macOS notarization for secure distribution