deno
222d30dd - feat(desktop): add Windows .msi installer output format (#35378)

Commit
153 days ago
feat(desktop): add Windows .msi installer output format (#35378) ## Summary Adds `.msi` as a `deno desktop` output format, alongside the existing `.dmg`/`.AppImage` and the `.deb`/`.rpm` formats added in #35296. As with those, the format is chosen by the `--output` extension (or the per-platform `output` key in the `desktop` block of `deno.json` — whose Windows description already documented `MyApp.msi`); the driver strips the extension, builds the intermediate Windows app dir, then wraps it in an MSI. The MSI database is authored entirely in pure Rust via the [`msi`](https://crates.io/crates/msi) crate, with the file payload stored in an embedded MSZIP cabinet ([`cab`](https://crates.io/crates/cab) crate), so it **cross-compiles from any host** — only the *target* must be Windows (gated like `.deb`/`.rpm` are gated on a Linux target). The app installs per-machine under `ProgramFiles64Folder\<AppName>\`, mirroring the staged app-dir tree exactly (nested directories like CEF's `locales/` are preserved); uninstall removes it. ``` %ProgramFiles%\<AppName>\ <AppName>.bat (launcher) laufey.exe (CEF backend) libcef.dll, ... (CEF support files) denort.dll (compiled runtime + user code) ... (nested dirs preserved) ``` ### Notable choices - **Deterministic GUIDs** — `ProductCode`, `UpgradeCode`, the package code, and per-component GUIDs are derived via UUIDv5 from the app identity (`--identifier`), so identical inputs produce an identical installer (matching the `source_date(0)` / `mtime: 0` reproducibility of the `.rpm`/`.deb`/AppImage paths) and the `UpgradeCode` is stable across versions. - **Directory/Component model** — one `Component` per install directory (a file's directory is carried by its component), `KeyPath` = the first file in that directory, components flagged 64-bit (`msidbComponentAttributes64bit`). A single `Feature` ties them together. - **Embedded cabinet** — one MSZIP folder holding every file named by its MSI `File` key, referenced by `Media.Cabinet = #appcab`. Summary stream marks the source compressed with long file names (`x64;1033` / `Arm64;1033` template). - **No new config fields** — metadata is derived from the staged app-dir name, `--identifier`, and the default `1.0.0` version that matches the macOS bundle. ### Metadata Derived from existing config (app-dir name → `ProductName`, `--identifier` → GUID seed, default `1.0.0` version). Help text for `--output` now lists `MyApp.msi`. ## Why This rounds out the desktop installer story for Windows — `.msi` was explicitly left out of the original desktop PR (#33441). `.msi` is what most Windows users/IT deployments install through. ## Tests Pure-Rust unit tests (cross-platform): triple→arch mapping, deterministic+valid GUID derivation, 8.3 short-name minting, and a full `create_windows_msi` round-trip that parses the produced MSI back and asserts the `Property`/`Directory`/`File`/`Component`/`Media` tables, the 1..N file sequence, the two-component layout for a nested dir, and that a file's bytes round-trip out of the embedded cabinet. All pass; clippy clean. As with `.deb`/`.rpm`, the matching-OS integration check (install / launch / upgrade / uninstall on a real Windows box) can't run in the cross-platform unit suite. Major-upgrade automation (an `Upgrade` table + `RemoveExistingProducts`) is intentionally left as a follow-up. ## New dependencies `msi = "0.10.0"` and `cab = "0.6.0"` (both pure Rust). Also enables the `v5` feature on the existing `uuid` dep. Closes #35377 Ref https://github.com/mdsteele/rust-msi/issues/59 Closes denoland/divybot#582 --------- Co-authored-by: divybot <divybot@users.noreply.github.com> Co-authored-by: Divy Srivastava <me@littledivy.com>
Author
Parents
Loading