Skip to main content

Crate embala_setup

Crate embala_setup 

Source
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.
FileSpec
A payload file: src on disk (already resolved to a real path), dest the /-separated install path relative to the install directory.
ProductInfo
Product identity carried into the manifest and, at install time, the embala.package Lua table + the ARP entry. Mirrors [package].
SetupSpec
Everything needed to author one setup.exe. Deliberately independent of the embala config types so the crate is usable on its own.
UninstallOptionSpec
One declarative uninstall option (spec R2). default pre-ticks its checkbox.

Enums§

Error
InstallMode
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.
SetupArch
Windows arch selecting the embedded stub.

Functions§

build
Build the setup.exe described by spec at out (parent dirs are created).
patched_stub_bytes
The arch stub with branding patched into its PE resources (spec R7/R9) — the exact bytes build() 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 (see embala dump-stub) and feed back as SetupSpec::signed_stub.

Type Aliases§

Result