.MSI
Windows Installer package
Introduction
An .msi file is a package for Windows Installer, the installation service
built into Windows. Rather than a program that copies files, it is a database that
describes the product: its features, components, files, registry entries and shortcuts,
and the steps to install them. Windows Installer reads the database and does the work,
which lets it repair, update and cleanly remove the product later.
Related files share the format: .msp patches and .msm merge
modules.
Software
- Windows Installer (
msiexec), built into Windows - Orca, the database editor in the Windows SDK (Windows)
- WiX Toolset, which builds MSI packages (Windows)
- lessmsi, which extracts the files (Windows)
- 7-Zip, which opens the streams inside (Windows)
Structure
An MSI file is a Compound File Binary, the “file system in a file” also used by old
Word, Excel and PowerPoint documents. It starts with the 8 bytes
D0 CF 11 E0 A1 B1 1A E1 and a 512-byte header, then divides the rest into
sectors linked together by an allocation table, holding a directory of named
storages and streams.
Inside, each database table, such as Property, Feature,
Component, File and InstallExecuteSequence, is
stored as a stream, with the strings shared through a string pool. The stream names are
encoded, so a plain compound file viewer shows them scrambled. The
SummaryInformation stream holds the title, author and the package code. The
files to install are usually packed into cabinet (.cab) archives stored as
streams inside the MSI, or beside it.
0compound file header: signature, sector sizes, allocation table location512 bytes512sectors, chained by the allocation table512 or 4096 bytes each…directory of storages and streamsvaries…table streams and the string poolvaries…SummaryInformation streamvaries…cabinet streams holding the filesvaries