Skip to main content

Crate pacenotes_installer

Crate pacenotes_installer 

Source
Expand description

The installer’s Win32-free logic, as a library so cargo test runs it on any host. The Windows-only binary (main.rs) owns http, ui and i18n.

Modules§

cache
The package cache inside the game folder: payloads named <sha256>.zip, which gives integrity, dedupe and an old version still reachable after the index has moved on, plus a cache.json index keyed by game/directory/name. The root is injected, so it is testable anywhere.
choices
Scene 5’s model: one pick each of language, codriver and style from what scene 4 committed; every other checked package installs as-is. Option labels are package paths, which are server data and never translated.
engine
The apply engine: plan from selection + ledger + cache, check, then execute.
gamedir
The games the installer targets, and the executable that makes a folder one of them, as the legacy InstallationForm.cs checked.
install
The per-game configuration step: what a game needs done to its own files once the packages are on disk. No shared abstraction on purpose, since the games share no file layout; the one contract is that a step reports every file it wrote, so the engine ledgers and backs those up like extracted ones.
ledger
The install ledger: what this installer put into a game folder, at .pacenotes\installed.json for every game, outside any plugin tree that packages or other installers also write to.
relative_path 🔒
restore
Taking a game folder back to a restore point, for a user handed a bad package who wants yesterday back: whatever they had configured then, and none of the files the bad package added. See DESIGN.md “Restore scene”.
runlog
The run log (DESIGN.md “Logging”): in memory for the progress panes, and on disk line by line for after a run that died. Only the UI thread writes it; workers post their lines.
schema
The install schemas this build embeds, compiled from schemas/<game>.toml by build.rs, and the one comparison made against the server’s.
sha256
A std-only SHA-256, because the sha2 crate’s generic stack costs tens of kB. Every download is verified with it and the cache is keyed by it. Names inside compress follow FIPS 180-4, so the code reads against the spec.
size
Byte counts as a person reads them, in binary units with the short labels, so they match what Explorer says about the same file.
tree
The Download scene’s model: manifest + cache → categories, levels and leaves with checkboxes. No Win32 and no display strings, so it is testable anywhere.
utc_time
UTC dates as text, with Howard Hinnant’s civil-from-days arithmetic, hand-rolled to spare a date crate.
zip
A zip reader over miniz_oxide, for game-root overlays: what is in a package, and putting it on disk where it says. No entry is ever interpreted, and there is no writer, since backups are plain file copies.