pacenotes_installer/ledger.rs
1//! The install ledger: what this installer put into a game folder, at
2//! `.pacenotes\installed.json` for every game, outside any plugin tree that
3//! packages or other installers also write to.
4//!
5//! It records what was written (a sha256 per file, so a file someone has
6//! since replaced is left alone), what was there before (so uninstall
7//! restores rather than deletes), paths under case-folded keys (as NTFS
8//! compares them), and a write-ahead state (so a run that died is recognised
9//! as ours).
10
11mod document;
12mod ownership;
13mod record;
14
15pub use document::{Ledger, LedgerState};
16pub use ownership::fold;
17pub use record::{EntryState, LedgerEntry, LedgerFile, Prior};
18
19/// Everything the installer owns inside a game folder, under one directory.
20pub const STATE_DIR: &str = ".pacenotes";
21
22const LEDGER_FILE: &str = "installed.json";
23
24#[cfg(test)]
25mod tests;