Skip to content

feat: add NSIS and MSI installer support for Windows#336

Open
Dyn4sty wants to merge 10 commits intoblackboardsh:mainfrom
Dyn4sty:feat/windows-nsis-msi-installers
Open

feat: add NSIS and MSI installer support for Windows#336
Dyn4sty wants to merge 10 commits intoblackboardsh:mainfrom
Dyn4sty:feat/windows-nsis-msi-installers

Conversation

@Dyn4sty
Copy link
Copy Markdown

@Dyn4sty Dyn4sty commented Mar 22, 2026

Summary

  • NSIS .exe installer: per-user/per-machine installs, desktop & Start Menu shortcuts, uninstaller with optional app-data cleanup, auto-download of NSIS toolchain when not on PATH
  • WiX v3 .msi installer: enterprise-ready MSI packages for GPO/SCCM/Intune deployment, deterministic UpgradeCode, major upgrade support, customizable UI assets, auto-download of WiX v3 toolchain
  • Windows build system improvements: auto-detect Visual Studio version for CMake generator, fix tar path handling for Git Bash/bsdtar, skip extractor build on Windows (replaced by installer pipeline)
  • Updater enhancements: detect user-writable vs elevated install dirs — user-writable uses existing update.bat + Task Scheduler, elevated (e.g. Program Files) downloads and runs the NSIS installer with /UPDATE /P /R for UAC-elevated replacement
  • Config types: nsis and msi configuration blocks added to ElectrobunConfig with full JSDoc documentation

Test plan

  • electrobun build on Windows produces .exe (NSIS) and .msi (WiX) installers alongside the existing .tar.zst
  • NSIS installer: per-user install, desktop shortcut, Start Menu entry, uninstall via Add/Remove Programs
  • MSI installer: per-user install, upgrade over existing version, uninstall
  • Setting nsis.enabled: false or msi.enabled: false skips the respective installer
  • Auto-update works from a user-writable install location (update.bat path)
  • Auto-update works from an elevated install location (NSIS /UPDATE path)
  • macOS and Linux builds are unaffected
  • CI builds work without pre-installed NSIS/WiX (auto-download)

Lior added 10 commits April 6, 2026 03:50
Windows tar (Git Bash) interprets absolute paths like "C:\..." as
remote URLs. Use path.basename() so extraction runs correctly.
- Auto-detect Visual Studio version for CMake generator selection
- Convert tar -C paths to Unix-style on Windows (bsdtar compat)
- Skip extractor build on Windows (uses NSIS/WiX pipeline instead)
- Guard extractor copy in copyToDist for Windows/debug builds
- Add nsis and msi configuration interfaces to ElectrobunConfig
- Add getNsisSetupFileName() and getMsiFileName() to shared naming
Automatically download and cache NSIS and WiX v3 binaries when
they are not found on PATH, enabling CI/dev builds without
pre-installed installer toolchains.
Generate .exe installers using NSIS with support for per-user and
per-machine installs, desktop/Start Menu shortcuts, uninstaller
registration, and optional app data cleanup.
Generate .msi packages for enterprise deployment (GPO/SCCM/Intune)
with deterministic UpgradeCode, major upgrade support, desktop and
Start Menu shortcuts, and customizable UI assets.
- Add rcedit helper for embedding Windows icons at runtime
- Add PNG-to-ICO conversion for installer icons
- Switch createTar to spawnSync to avoid shell escaping issues
- Escape single quotes in PowerShell command paths
- Wire up NSIS and MSI generation during non-dev Windows builds
- Scope macOS self-extracting bundle logic to macOS only
- Derive app path from process.execPath instead of fixed appData/app
- Add canWriteToDir() probe to detect install location permissions
- User-writable installs use update.bat + Task Scheduler as before
- Elevated installs (e.g. Program Files) download and run the NSIS
  installer with /UPDATE /P /R for UAC-elevated file replacement
Add nsis and msi configuration blocks to the kitchen sink example
and update lockfiles for new dependencies.
Run `ie4uinit.exe -show` to flush the Windows Icon Cache Database so
that newly embedded or shortcut-referenced icons display immediately
instead of showing stale/generic icons.

- CLI dev build: call via Bun.spawnSync after rcedit icon embedding
- NSIS installer: nsExec after shortcut creation and deletion
- WiX/MSI installer: CustomAction scheduled after InstallFinalize

All calls are best-effort and non-fatal.

Made-with: Cursor
@Dyn4sty Dyn4sty force-pushed the feat/windows-nsis-msi-installers branch from 67f0bdf to 133305b Compare April 6, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant