Glossary
MSI Database Tables
How an MSI stores a relational database: the string pool, the _Tables and _Columns bootstrap, column types and column-major rows.
The heart of an MSI is a small relational database, stored as streams inside the compound file. It bootstraps from a few special tables:
_StringData+_StringPool— a shared, reference-counted string pool. Every text value in every table is an index into this pool, so a string used many times is stored once. The pool header also records the code page and whether string references are 2 or 3 bytes wide._Tables— the list of table names._Columns— for each table, its columns: number, name and a type word whose bits encode string vs integer, size, nullable and key.
From those, every other table is decoded. Two details trip up naïve readers:
- Stream names are encoded. Table and column stream names are packed into a
private Unicode range (
0x3800–0x4840), two base-64 symbols per code unit, with a leading0x4840marking a table. A reader must decode them to recover names likePropertyorCustomAction. - Rows are column-major. A table stream stores all of column 1 for every
row, then all of column 2, and so on. Integers are stored with the high bit
flipped and
0meaning null; a 2-byte integer and a 4-byte integer are distinguished by the column's declared size.
Get these rules right and the whole authoring database — Property, File,
Component, Registry, Shortcut, CustomAction and the rest — reads cleanly.