MSI

On this page 7

MSI is the Windows Installer package format: a file with the .msi extension that describes an application’s files, registry entries, shortcuts and settings as a structured database, which the Windows Installer service reads to install, repair, upgrade and remove the software. In software installation and packaging, MSI is the long-standing standard for managed, scriptable deployment on Windows desktops and servers.

Unlike a self-extracting setup program that runs arbitrary code, an MSI package is mostly declarative. It states what the finished installation should look like, and the Windows Installer engine, invoked through msiexec.exe, works out the steps, records what it changed and can roll back the whole operation if something fails.

How an MSI package is structured and executed

An MSI file is a relational database stored in a compound file, with dozens of predefined tables that link features, components and resources. The smallest unit of installation is the component, a group of files and registry keys that are always installed together and identified by a unique component GUID. Components are grouped into features, which users or administrators can select.

During installation the engine walks through sequence tables of standard actions, such as cost calculation, file copying and registry writing. It first builds a script of planned changes, then executes it with elevated rights as a single transaction. If an error occurs, it uses the saved backup information to restore the system to its prior state.

The table lists the identifiers and tables that matter most when working with MSI packages.

ElementWhat it representsWhy it matters
ProductCodeGUID of one product version familyIdentifies what is installed
UpgradeCodeGUID shared across versionsLets new versions find old ones
PackageCodeGUID of one specific .msi fileDistinguishes package builds
Feature tableSelectable parts of the productControls optional functionality
Component tableAtomic install unitsBasis for repair and reference counting
CustomAction tableCode run beyond standard actionsMost frequent source of failures
Property tableSettings such as INSTALLDIRConfigurable at the command line
Key MSI identifiers and tables

Installing, configuring and removing with msiexec

Administrators control MSI packages through the msiexec command line, which makes MSI well suited to automated deployment. Public properties written in uppercase can be set at install time, for example to choose an installation folder or disable an optional feature.

Option or codeMeaningTypical use
/iInstall a packageStandard deployment
/xUninstall by package or ProductCodeRemoval scripts
/qnNo user interfaceSilent unattended installation
/l*vVerbose log to a fileDiagnosing failures
/faForce reinstall of all filesRepairing damaged installations
Exit code 0SuccessNo action needed
Exit code 3010Success, restart requiredSchedule a reboot
Exit code 1603Fatal error during installationInspect the verbose log
Exit code 1618Another installation in progressRetry later
Common msiexec options and exit codes

Organizations customize vendor packages with transforms (.mst files), which modify the database at install time without altering the original file. Updates are delivered as patches (.msp files) or as full packages that perform a major upgrade, removing the old version and installing the new one.

MSI compared with other installer and package formats

MSI is one of several ways to deliver software on Windows and elsewhere. Its strengths are transactional installation, repair and central management; its weaknesses are complexity and the lack of isolation, since installed files and registry entries go directly into the shared system.

FormatPlatformIsolationMain strength
MSIWindowsNone, writes to systemEnterprise deployment and repair
EXE installerWindowsNoneFull flexibility for vendors
MSIXWindowsContainer-like virtualizationClean uninstall, modern updates
FlatpakLinuxSandboxed runtimeDistribution-independent desktop apps
SnapLinuxConfined packagesAutomatic updates
AppImageLinuxSelf-contained, no installPortable single file
MSI and related package formats

MSIX is the designated successor for many scenarios, adding an application sandbox and reliable removal, but MSI remains widespread because many business applications need drivers, services or deep system integration that MSIX restricts.

Building and deploying MSI packages

MSI packages are created with authoring tools rather than by editing tables directly. The open source WiX Toolset describes packages in XML and compiles them, while commercial tools provide visual editors and repackaging features. The choice of approach depends on who controls the source and how packages are distributed.

SituationRecommended approachReason
Vendor ships an MSICustomize with an MST transformKeeps the original package supportable
Vendor ships only an EXEUse documented silent switchesRepackaging may break updates
In-house applicationAuthor MSI with a build toolRepeatable builds in CI pipelines
Domain-managed PCsDeploy through endpoint managementCentral inventory and reporting
Need clean removal and sandboxingConsider MSIX insteadBetter isolation
Packaging and deployment decisions

Good authoring follows the component rules: a resource belongs to exactly one component, and a component GUID never changes meaning across versions. Breaking these rules leads to files left behind after uninstall or unexpected self-repair prompts.

Common MSI problems and how to avoid them

Most MSI failures trace back to custom actions, conflicting versions or missing logs. The engine itself is robust, but scripts embedded in packages often assume conditions that do not hold on managed machines.

  • Deploying without a verbose log makes error 1603 nearly impossible to diagnose.
  • Changing the UpgradeCode between versions leaves old and new versions installed side by side.
  • Custom actions that ignore rollback leave partial changes after a failed installation.
  • Deleting the Windows Installer cache breaks later repair, patching and uninstall.
  • Mixing per-user and per-machine installs of the same product causes confusing duplicate entries.

In simple terms

An MSI file is like a detailed packing list plus assembly instructions for a program. Instead of a program that installs itself however it likes, the file tells Windows exactly which pieces go where, and Windows does the work.

Because Windows keeps track of everything it installed, it can fix a broken program, upgrade it or remove it cleanly, and it can undo a half-finished installation. That predictability is why companies that manage thousands of computers rely on MSI packages.

A practical example

The IT team at a regional hospital must deploy a new version of a document viewer to 2,000 workstations overnight. The vendor supplies an MSI package. Instead of editing it, the team creates an MST transform that disables automatic updates, sets the default language and removes a desktop shortcut.

The deployment runs through the endpoint management system with msiexec /i, the transform and /qn, plus a verbose log for each machine. The package performs a major upgrade using the shared UpgradeCode, so the old version is removed automatically. By morning, 1,968 machines report exit code 0 and 21 report 3010 and reboot during the next maintenance window. The remaining 11 fail with 1618 because another installation was running; they succeed on the automatic retry. The outcome is a fully reported, reversible rollout without visiting a single desk.