Expand description
Windows setup.exe builder (prebuilt stub + PE overlay).
Honors embala’s byte-writer invariant: embala build never compiles. The
Win32 runtime stub (embala-setup-runtime) is cross-compiled once by
just stubs and committed under stubs/<target>/setup-stub.exe; this crate
include_bytes!-embeds it and appends payload.zip + install.lua + uninstall.lua + manifest + signed_stub + pad + trailer as a PE overlay — pure byte-writing,
no compile, no network. The pad is zero-to-seven bytes so the unsigned file
length is 8-byte aligned: an appended Authenticode cert table then starts at
the security-directory offset the runtime reads as the overlay end. Output is
byte-reproducible: the payload zip pins entry
mtimes and sorts entries, so the whole setup.exe is a pure function of
(stub, scripts, manifest, payload).
Scope grows per phase. Phase 3 carries the real manifest (product identity +
resolved install mode, spec R8) and ships the caller’s install.lua /
uninstall.lua bytes verbatim (spec R7) — the runtime’s mlua host runs them.
When no install.lua is supplied the Phase-2 extraction-only placeholder
still ships. The wizard arrives with Phase 5.
Structs§
- Branding
- Product identity + optional bitmaps patched into the stub. Self-contained so the crate stays independent of the embala config types.
- File
Spec - A payload file:
srcon disk (already resolved to a real path),destthe/-separated install path relative to the install directory. - Product
Info - Product identity carried into the manifest and, at install time, the
embala.packageLua table + the ARP entry. Mirrors[package]. - Setup
Spec - Everything needed to author one
setup.exe. Deliberately independent of the embala config types so the crate is usable on its own. - Uninstall
Option Spec - One declarative uninstall option (spec R2).
defaultpre-ticks its checkbox.
Enums§
- Error
- Install
Mode - Default install mode baked into the manifest (spec R13). Config-independent,
mirroring the config’s own enum; a
/mode=CLI flag overrides it at install time. - Setup
Arch - Windows arch selecting the embedded stub.
Functions§
- build
- Build the
setup.exedescribed byspecatout(parent dirs are created). - patched_
stub_ bytes - The
archstub withbrandingpatched into its PE resources (spec R7/R9) — the exact bytesbuild()overlays and the in-build signing path signs. - stub_
bytes - The committed bare setup stub for
arch— the exact bytes external signing flows sign out-of-band (seeembala dump-stub) and feed back asSetupSpec::signed_stub.