Files in an embedded, uncompressed cabinet #3

Closed
opened 2026-10-14 01:26:51 -05:00 by jeff · 1 comment
Owner

Parent

Part of #1

What to build

An installer package that installs files. Directory (with the standard folders such as ProgramFiles64Folder), Component, File and Media with EmbedCab="yes" and CompressionLevel="none" put a program's files into a cabinet per [MS-CAB] embedded in the installer package, and Windows Installer puts them where the WiX source says.

Source paths follow the spec: \ and / both separate, they are relative to the WiX source's directory, case is never folded, and one that does not exist is an error naming it and the element that asked. Long file names get deterministic 8.3 short names.

Acceptance criteria

  • Seam 1 tests assert the Directory, Component, File, Media and FeatureComponents rows for a fixture with nested directories and several files.
  • Seam 1 tests: a source path written with \ resolves on Linux; one differing only in case does not; a missing one is a diagnostic naming the path and the element.
  • Seam 1 tests: two long names sharing a prefix get distinct short names, the same ones on every run.
  • VM test: the tables match the reference implementation's with generated columns masked.
  • VM test: after a Wine install every file is present at its destination with the right contents; after uninstall they are gone.
## Parent Part of #1 ## What to build An installer package that installs files. `Directory` (with the standard folders such as `ProgramFiles64Folder`), `Component`, `File` and `Media` with `EmbedCab="yes"` and `CompressionLevel="none"` put a program's files into a cabinet per [MS-CAB] embedded in the installer package, and Windows Installer puts them where the WiX source says. Source paths follow the spec: `\` and `/` both separate, they are relative to the WiX source's directory, case is never folded, and one that does not exist is an error naming it and the element that asked. Long file names get deterministic 8.3 short names. ## Acceptance criteria - [ ] Seam 1 tests assert the `Directory`, `Component`, `File`, `Media` and `FeatureComponents` rows for a fixture with nested directories and several files. - [ ] Seam 1 tests: a source path written with `\` resolves on Linux; one differing only in case does not; a missing one is a diagnostic naming the path and the element. - [ ] Seam 1 tests: two long names sharing a prefix get distinct short names, the same ones on every run. - [ ] VM test: the tables match the reference implementation's with generated columns masked. - [ ] VM test: after a Wine install every file is present at its destination with the right contents; after uninstall they are gone.
jeff self-assigned this 2026-10-14 03:00:50 -05:00
Author
Owner

Done in f235aad; CI run 3 passed test and e2e (its docs job was cancelled when the push for #4 superseded it).

  • Seam 1: tests/database.zig checks the Directory, Component, File, Media, FeatureComponents and MsiFileHash rows. It also covers:
    • a \ source path resolving;
    • a source path differing only in case failing;
    • a missing source path naming the path and the file;
    • deterministic distinct short names (LONGFI~1.TXT, LONGFI~2.TXT);
    • default file Ids;
    • duplicate key paths;
    • an unknown ComponentRef, and a component in no feature (a warning).
  • End to end: the files fixture's tables match wixl's once the SHORT| prefix wixl never writes is stripped. cabextract verifies the cabinet, and under Wine every file listed in files.installed lands with its contents and is gone after uninstall.

What I found about the reference implementation:

  • It writes no 8.3 short names at all.
  • It doesn't accept \ in source paths on Linux.
  • It ignores CompressionLevel and Component/@KeyPath.
  • It hashes every file into MsiFileHash and never reads a version resource.
  • A component with no marked key path takes its first file.
Done in f235aad; CI run 3 passed `test` and `e2e` (its `docs` job was cancelled when the push for #4 superseded it). - **Seam 1:** `tests/database.zig` checks the Directory, Component, File, Media, FeatureComponents and MsiFileHash rows. It also covers: - a `\` source path resolving; - a source path differing only in case failing; - a missing source path naming the path and the file; - deterministic distinct short names (`LONGFI~1.TXT`, `LONGFI~2.TXT`); - default file Ids; - duplicate key paths; - an unknown ComponentRef, and a component in no feature (a warning). - **End to end:** the `files` fixture's tables match wixl's once the `SHORT|` prefix wixl never writes is stripped. `cabextract` verifies the cabinet, and under Wine every file listed in `files.installed` lands with its contents and is gone after uninstall. What I found about the reference implementation: - It writes no 8.3 short names at all. - It doesn't accept `\` in source paths on Linux. - It ignores `CompressionLevel` and `Component/@KeyPath`. - It hashes every file into MsiFileHash and never reads a version resource. - A component with no marked key path takes its first file.
jeff closed this issue 2026-10-14 03:27:38 -05:00
Sign in to join this conversation.
No description provided.