What Is an MSI File? The Windows Installer Package, and How to Open, Install and Check One
An MSI file is a Windows Installer package that stores the files, settings and steps for one program. Three readers gave one answer on 6 of the 21 damaged copies we made of one. Jump to your question below, or work through it in order.
What Is an MSI File? The Windows Installer package that stores files, settings and steps
Short answer
An MSI file is a Windows Installer package. It stores the files, settings and steps that Windows needs to install one program. The msiexec tool reads it, and the file starts with the bytes D0 CF 11 E0 A1 B1 1A E1.
We tested 89 public MSI, MSP, MST and MSM files with three readers, msiinfo, 7-Zip and olefile. 87 opened in all three. We then damaged one package in 21 ways, and the three readers gave one answer on 6 copies.
To look inside one, see the open steps. To install one, see the install steps. If your MSI file will not install, begin with the causes.
An MSI file is a Windows Installer package. It stores the files, settings and steps that Windows needs to install one program, and the msiexec tool reads it. Windows Installer comes with Windows 2000 and later.
Picture a download folder with an MSI file named setup.msi. You double-click it and a wizard opens. Picture a second MSI file that your IT team sends to 400 laptops with no wizard at all. Both files are the same kind, and the same service reads both.
Wikipedia says the service was once named Microsoft Installer, and its codename was Darwin. The first release came on 31 August 1999. The last release, version 5.0, came on 22 July 2009. The program that reads a package is msiexec.
A package is a small database. Wikipedia calls it a loosely relational database built as a COM structured storage. Microsoft's overview says the service installs, maintains and removes applications, updates and services.
The design brings two gains. Wikipedia says the uninstall steps are built for you. Wikipedia also says the service checks one marked file or entry for every component when a program starts. If that item is missing, it reinstalls the feature.
It also has limits. Wikipedia says Windows Installer does not handle dependencies between products. A step outside the standard set needs a custom action, and Wikipedia says a custom action is normally a DLL. So an MSI file is a database that can start code.
Where our MSI files come from
We read 89 public files. 68 came from the test folders of the WiX 3 project, 18 from the WiX project, 2 from winget and 1 from remoteinstall. There are 77 .msi files, 8 .msp files, 1 .mst file and 3 .msm files.
They are test files and not installers from software vendors. They are 3,584 to 290,816 bytes long, the median is 15,872 bytes and the total is 3,682,087 bytes. 72 of the 76 packages that msiinfo opened name a WiX version in their summary.
So this page studies how readers treat the layout, and not a sample of programs from the web. We installed none of them, because Windows Installer needs Windows and our lab uses Linux. We make no claim about what Windows shows when it opens one.
MSI file facts at a glance
| Property | Value |
|---|---|
| Meaning | Microsoft Installer at first, now Windows Installer, per Wikipedia. |
| Ending | .msi for a package. A patch is .msp, a transform is .mst and a merge module is .msm, per Wikipedia. |
| Maker | Microsoft, per Wikipedia. |
| Reader |
msiexec, and the Windows Installer service behind it.
|
| Layout | An OLE compound file with streams. Most streams are tables, per our tests and Wikipedia. |
| First bytes |
d0 cf 11 e0 a1 b1 1a e1. Our example then reads 62 and 3 as the version.
|
| Kinds | Named by the root CLSID: 000C1084 for a package, 000C1086 for a patch and 000C1082 for a transform. 76, 8 and 1 of our files. |
| Status | The last release is version 5.0 from 2009, and it comes with Windows 7 and later, per Wikipedia. |
| Our tests | 89 files, 21 damaged copies, 3 readers, a check script of 22 lines and a repair script of 10 lines. |
Wrong page? An EXE file is a program that starts itself. See how MSI files differ from EXE files.
Which Kind of MSI File Do You Have? Four kinds, and the root CLSID names the kind
Four file endings belong to Windows Installer: .msi for a package, .msp for a patch, .mst for a transform and .msm for a merge module. The root CLSID names the kind. It starts 000C1084 for 76 of our packages, 000C1086 for 8 patches and 000C1082 for 1 transform.
The ending of an MSI file is a label that anyone can change. The first 8 bytes read the same in all four kinds. The CLSID is a number stored in the first directory entry, and it differs by kind. Follow the figure.
The kinds in detail
| Kind | Files and results |
|---|---|
| MSI, an install package | 77 files. 76 have the CLSID 000C1084, and all three readers opened those 76. The 77th starts with the OLE bytes and then contains XML text, so all three refused it. |
| MSP, a patch | 8 files. All have the CLSID 000C1086, and all three readers opened all 8. The Template field lists the product codes the patch can update, per the Template property. |
| MST, a transform | 1 file. It has the CLSID 000C1082, and all three readers opened it. Its Template field reads Intel;1033. |
| MSM, a merge module | 3 files. Two opened in all three readers. The third has 15 CRLF pairs inside it, and all three readers failed on it. |
Read the summary stream
Every file has a stream named SummaryInformation. Microsoft lists its properties, and four of them describe the package. We read them with msiinfo on the 76 packages it opened.
| Property | What we measured |
|---|---|
| Page Count | The minimum Windows Installer version, per the Page Count property. 58 packages say 200, 8 say 300 and 10 say 500. |
| Word Count | A set of flags, per the Word Count property. 54 say 0, 20 say 2 for a compressed source and 2 say 10 for a compressed source with no elevation needed. |
| Security | The values 0, 2 and 4, per the Security property. 73 packages say 2, read-only recommended. 3 say 1, a value that page does not list. |
| Template | A platform and a language, per Microsoft. 73 say Intel and 3 say x64. |
Not sure your file is an MSI file at all? Check it with our script.
What Is Inside an MSI File? A header, a FAT, a directory and 24 streams
An MSI file is an OLE compound file with a header, a FAT, a directory and streams. Our example is 18,432 bytes long and has 24 streams: 22 for tables and strings, one summary and one cabinet. The header takes the first 512 bytes.
We looked inside one MSI file because its layout explains every result later on this page. Our hello_world comes from the WiX 3 test folder. It installs one file, Readme.txt, and its start shows the header.
xxd -l 48 hello_world.msi
00000000: d0cf 11e0 a1b1 1ae1 0000 0000 0000 0000 ................
00000010: 0000 0000 0000 0000 3e00 0300 feff 0900 ........>.......
00000020: 0600 0000 0000 0000 0000 0000 0100 0000 ................
file -b hello_world.msi | cut -d, -f1-5
Composite Document File V2 Document, Little Endian, Os: Windows, Version 6.1, MSI Installer
The first 8 bytes are the OLE magic. Bytes 24 to 27 read 3e 00 03 00, the version 62 and 3. Bytes 28 and 29 read fe ff, the byte order. Bytes 30 and 31 read 09 00, so a sector is 512 bytes. A mini sector is 64 bytes.
The parts, one by one
The file has 35 sectors after the header. The FAT takes one sector and lists which sector follows which. The directory takes seven sectors and has 28 slots, and 25 are in use. The first is Root Entry, and the other 24 are streams.
Streams under 4,096 bytes live in a mini stream that Root Entry points to, and it is 5,824 bytes long. 23 of our 24 streams are that small. Only the string data, at 6,845 bytes, lies in ordinary sectors. The cabinet stream is 292 bytes long.
What every part stores
| Part | What it stores |
|---|---|
| Magic | D0 CF 11 E0 A1 B1 1A E1. Copy A1 changes the first byte, and all three readers refused it. Our repair script restores it. |
| Version and sector size | Version 62 and 3 with 512 byte sectors in 68 files, and version 62 and 4 with 4,096 byte sectors in 20. Copy A4 sets a sector of 1,024 bytes, and msiinfo and 7-Zip refused it. |
| FAT | One sector here. Copy C2 marks the directory sector as free, and msiinfo and 7-Zip refused it. Copy C8 zeroes the FAT, and the same two refused it. |
| Directory | The names, sizes and start sectors of all streams. The Root Entry CLSID names the kind. Copy C7 zeroes the sector, and the same two readers refused it. |
| Table streams | 22 streams in our example. Their names start with the character U+4840 and pack every letter into a short code, so we used a small decoder to read them. |
| Cabinet stream | A Microsoft cabinet that stores the program files. 14 of our 76 packages have one inside, and 7 name one outside the file. 7-Zip lists Readme.txt inside ours, size 292. |
| Summary stream | The title, the template, the version and the flags. Copy C6 flips one byte in it, and msiinfo and olefile saw the change while 7-Zip did not. |
What the Microsoft pages say about one table
The _Validation table lists every column and the values it allows. The validation table page says the table is used for validation and is not shipped with the database. All 76 packages that msiinfo opened contain it.
So the page and our files disagree, and our files come from build tools and test folders. Our example has 20 tables by the msiinfo count, and the largest package has 89. The median across the 76 packages is 17.
The map is small. Our script checks the magic, the header fields, the FAT, the directory name, the kind and a few markers. It does not read the tables, so it cannot judge them. Copies C3 to C6 show the limit, because the script printed OK for all four and a reader saw a change.
What Did We Find in 89 Test MSI Files? Three readers, and 87 files opened in all of them
We tested 89 public MSI files with three readers. 87 opened in all three, 2 opened in none and no file split the readers. On undamaged files the file decided the result, and not the reader.
We counted a file as opened when a reader read it without an error. msiinfo listed the tables. 7-Zip named the type Compound. olefile read every stream. We used msiinfo 0.103 from msitools, 7-Zip 23.01 and olefile 0.47 on Linux.
What the numbers show
| Finding | What we measured |
|---|---|
| Packages are easy | 76 of the 77 .msi files opened in all three readers. All 8 patches and the 1 transform did too. |
| Two files fail for a clear reason | One .msi file is XML text with the OLE bytes written over its start. One .msm file contains 15 CRLF pairs. All three readers refused both. |
| A text mode copy can be undone | We removed the 15 CR bytes from the .msm file. It went from 14,351 to 14,336 bytes, and all three readers opened it. |
| Nearly all sizes fit a sector | 86 of 89 files are an exact multiple of 512 bytes. 68 files use 512 byte sectors and 20 use 4,096 byte sectors. |
| Cabinets live inside or outside | 14 of the 76 packages store a cabinet in the file and 7 name one outside it. We cover what that means for extraction below. |
| Three files contain a signature stream | 3 packages contain a DigitalSignature stream and a certificate stream. We did not check any signature. |
What this study cannot show you
These are test files from build tools and test folders. They are not installers from software vendors, and many are made to test one table or one bug. A refusal on the 2 broken files is the right answer.
We installed no file with Windows Installer. Opening a file in a reader means the container is well formed. It does not mean Windows would install the program.
What Happens When an MSI File Is Damaged? 21 broken copies, and the three readers agreed on 6
We damaged one MSI file in 21 ways. The three readers gave one answer on 6 copies and split on 15. Our script flagged or warned on 15 copies, and 3 of those 15 read as the original in all three readers.
Our base file is hello_world, 18,432 bytes. We changed one thing at a time and saved 21 copies. Same means a reader gave the answer it gave on the original. Refused means it stopped with an error. Differs means it opened the copy and answered another way.
The three readers check different things. msiinfo reads the tables, the summary and the cabinet. 7-Zip lists names and sizes. olefile reads the bytes of every stream. So a flipped byte can change two answers and leave the third alone.
What the grid shows
| Group of copies | What happened |
|---|---|
| A wrong magic | Copy A1 changes the first byte. All three readers refused it. The repair script restores it, and all three readers then gave the original answer. |
| A wrong version or sector size | Copy A2 sets the minor version to 0 and A9 fills six reserved bytes. All three read both as the original. Copy A4 sets a sector of 1,024 bytes, and msiinfo and 7-Zip refused it. |
| A wrong byte order | Copy A3 swaps the byte order marker. msiinfo and olefile read it as the original, and 7-Zip refused it. |
| A wrong FAT or directory | Copies A6, A7, C2, C7 and C8 break the FAT or the directory. msiinfo and 7-Zip refused all five, and olefile gave another answer on four. |
| A short or long file | Copy B1 removes the last 512 bytes, and only 7-Zip read it as the original. B2 cuts the file in half, and msiinfo and 7-Zip refused it. B3 adds 512 zero bytes, and all three read it as the original. |
| A text mode transfer | Copy B4 changes every LF into CRLF. msiinfo and 7-Zip refused it, and olefile gave another answer. |
| A flipped byte in a stream | Copies C3 to C6 flip one byte in the strings, the cabinet, the validation table and the summary. 7-Zip read all four as the original, because every name and size stayed the same. olefile saw all four. |
The pattern is clear. When the container breaks, msiinfo and 7-Zip stop. When one byte inside a stream changes, 7-Zip stays silent, and the other two split. msiinfo saw C3, C4 and C6 but not C5, which is the validation table.
Our script and the repair script
Our check script flagged or warned on 15 copies. 3 of them, A2, A8 and C1, read as the original in all three readers. The script printed OK for 6 copies. For B3 and A9 that was right. For C3 to C6, a reader saw a change. See the script.
The repair script rewrites the header fields. It made 7 copies match the original byte for byte, A1 to A5, A8 and A9. For A1, A3, A4 and A5 that fixed a refusal or a split. It left the other 13 copies as they were.
The script cannot restore a cut file, a broken FAT, a changed stream or a text mode copy. We did not test a repaired file in Windows Installer.
Why a text mode copy is special
Copy B4 changes LF into CRLF, and a text mode transfer does the same. Our base file has 21 LF bytes and no CRLF pairs, so the change is reversible there. A blind CR removal is not safe in general.
17 of the 89 files contain a CRLF pair by chance. A tool that removes every CR from those 17 would damage them. Our .msm test file is the other case: it has 15 pairs and 15 LF bytes, and removing the CR bytes made all three readers open it.
What Does Our Expert Say About MSI Files? A note from Neeraj Singh on comparing readers
We asked our expert what the grid means for someone who has an MSI file and has to decide if it is damaged. He read the 21 copies and the three reader columns.
Expert insight
Never judge an MSI file with one tool. In our tests one flipped byte in the string data changed what two readers returned, while 7-Zip listed the same names and sizes and our own header check printed OK. Open the file with a second tool before you decide it is sound.
That advice fits the grid. msiinfo and 7-Zip gave the same answer on 15 of the 21 copies. msiinfo and olefile agreed on 10, and 7-Zip and olefile on 7. A second tool that reads the stream bytes is the cheapest test.
How Do You Open an MSI File? Look inside and pull the files out, without installing
To look inside an MSI file without installing it, use msiinfo and msiextract on Linux, 7-Zip or the Python library olefile. All three readers opened 87 of our 89 files. msiextract wrote program files from the 14 packages that store a cabinet inside.
An install is not the only way to read a package. The file is a container, and a reader can list its tables and pull out its files. Microsoft lists /a as an administrative install, so Windows has a built-in route too. We could not test it.
Your options
Read an MSI file without installing it
Start with the summary and the table list. Neither one changes the file. The summary shows who made the package, and the table list shows how large it is. Our example has 20 tables, and the first 8 are below.
msiinfo suminfo hello_world.msi
Title: Installation Database
Subject: HelloWorld_Readme
Author: My Company
Keywords: Installer
Comments: This Installer database contains the logic and data required to install HelloWorld_Readme.
Template: Intel;1033
Revision number (UUID): {FBD9C730-4484-4B19-81C5-ABFA0381F617}
Created: Fri Jan 8 04:21:26 2010
Last saved: Fri Jan 8 04:21:26 2010
msiinfo tables hello_world.msi | head -8
_SummaryInformation
_ForceCodepage
_Validation
AdminExecuteSequence
AdminUISequence
AdvtExecuteSequence
Component
Directory
Export a table to read its rows. The File table lists every file in the package with its size. Our example has one row, Readme.txt, at 292 bytes.
msiinfo export hello_world.msi File
File Component_ FileName FileSize Version Language Attributes Sequence
s72 s72 l255 i4 S72 S20 I2 i4
File File
Readme.txt Readme.txt Readme.txt 292 512 1
Pull the files out of an MSI file
The Media table says where the files are. A cabinet name that starts with a number sign, like #HelloWorld_Readme.cab, means the cabinet is a stream inside the file. A name without the sign means the cabinet is a separate file.
msiinfo export hello_world.msi Media
DiskId LastSequence DiskPrompt Cabinet VolumeLabel Source
i2 i4 L64 S255 S32 S72
Media DiskId
1 1 #HelloWorld_Readme.cab
In our 76 packages, 14 name a cabinet inside, 7 name one outside, 51 name none and 4 have no Media rows. msiextract wrote files from all 14 with a cabinet inside.
msiextract -C out hello_world.msi
Program Files/HelloWorld_Readme/Readme.txt
find out -type f
out/Program Files/HelloWorld_Readme/Readme.txt
For the 7 packages with an outside cabinet, msiextract wrote no files and exited with code 1. Its error names the cabinet HelloWorldNonAdmin_Readme_External and says there is no such file. It looks in the folder of the MSI file, so put the .cab file beside it.
We had no cabinet for those 7 files, so we did not test that fix. msiextract also exited with code 1 on 10 other packages and wrote no files from them. Its first message is a missing Directory id in 9 of them and a missing table in 1.
Is the file a ZIP archive? The ZIP file page covers ZIP files.
How Do You Install an MSI File? Double-click it, or use msiexec with the options
To install an MSI file, double-click it, or use msiexec /i with the path. Add /passive for a progress bar, /qn for no window and /l*v for a log. We installed no file, because msiexec needs Windows and our lab uses Linux.
Everything in this section comes from the msiexec page at Microsoft. We did not test the commands. We list them so you can read a package first, as shown in the steps to read a package, and then install it.
- Copy the MSI file to a local folder and keep the original.
- Read the summary with msiinfo, as shown above. Check the maker and the product name.
- Double-click the file for the wizard, or open a Command Prompt for msiexec.
-
Type
msiexec.exe /i "C:\example.msi"and press Enter. -
Add
/L*V "C:\package.log"when you want a log. The log is the first place to look if the install fails. - Restart when the installer asks. A restart is not a failure, and Microsoft counts code 3010 as success.
The msiexec options
| Option | What it does |
|---|---|
/i
|
A normal install. |
/x
|
Uninstalls a package. |
/a
|
An administrative install. |
/p
|
Installs a patch. For a silent patch, Microsoft adds REINSTALLMODE="ecmus" REINSTALL="ALL".
|
/f with letters
|
Repairs an installed package. /fa forces all files to be reinstalled.
|
/quiet
|
No user interaction. |
/passive
|
Shows only a progress bar. |
/qn and /qb
|
No window, and a basic window. |
/
|
Stops a restart after the install. |
/
|
Restarts the device after the install. |
/L*V and a path
|
Writes a log of everything, with verbose output. |
Commands from the Microsoft page
msiexec.exe /i "C:\example.msi"
msiexec.exe /i "C:\example.msi" /qn
msiexec.exe /i "C:\example.msi" /norestart
msiexec.exe /i "C:\example.msi" /L*V "C:\package.log"
msiexec.exe /p "C:\MyPatch.msp"
msiexec.exe /fa {AAD3D77A-7476-469F-ADF4-04424124E91D}
The last line repairs an installed product by its product code. Our example package lists its code in the Property table, and msiinfo export hello_world.msi Property prints it.
Two of our 76 packages set the Word Count flag 10. The Word Count page says bit 8 marks a package that needs no elevated privileges, and bit 2 marks a compressed source. A package with that flag says it needs no elevated privileges.
What we did not test. We used no Windows machine. We did not start msiexec, install any package, open Orca or check any signature. Treat the commands as Microsoft's, and not as our results.
Does the install end with a number? Read the error codes for 1603, 1618, 1619 and 1620.
How Do You Check an MSI File? Six steps and a script of 22 lines
Check an MSI file in six steps. Copy it, read the first bytes, read the version and the sector size, read the root CLSID, list the tables and use a second reader. Our script of 22 lines does steps two to four.
- Copy the file and work on the copy. Keep the original.
-
Read the first bytes with
xxd -l 48 file.msi. The first eight bytes must readd0 cf 11 e0 a1 b1 1a e1. -
Read bytes 24 to 27.
3e 00 03 00means 512 byte sectors, and3e 00 04 00means 4,096 byte sectors. We saw both. - Read the root CLSID. 000C1084 is a package, 000C1086 is a patch and 000C1082 is a transform.
-
List the tables with
msiinfo tables file.msi. A package opens with at least 11 tables in our set. - Use a second reader like 7-Zip or olefile. The three readers gave one answer on only 6 of 21 damaged copies.
The check script
The script reads one file at a time. It prints OK when the header, the FAT and the directory agree. It prints WARN for a small oddity and FLAG when something is wrong. It uses only the Python standard library.
import struct, sys
d = open(sys.argv[1], 'rb').read()
M = bytes.fromhex('d0cf11e0a1b11ae1'); w = []
KIND = {'84': 'install package (.msi)', '86': 'patch (.msp)', '82': 'transform (.mst)'}
if d[:8] != M: print('FLAG magic bytes are not D0CF11E0A1B11AE1'); sys.exit()
mi, ma, bo, ss, ms = struct.unpack('<HHHHH', d[24:34]); sz = 1 << ss if ss < 16 else 0
nf, ds, _, cut, mf = struct.unpack('<IIIII', d[44:64]); f0 = struct.unpack('<I', d[76:80])[0]
if bo != 0xFFFE or (ma, ss) not in ((3, 9), (4, 12)) or ms != 6 or mi != 62: w.append('FLAG header fields are not a valid v3 or v4 file')
elif nf < 1 or (f0 + 2) * sz > len(d) or (ds + 2) * sz > len(d): w.append('FLAG FAT or directory sector is past the end')
else:
e = d[(ds + 1) * sz:(ds + 2) * sz][:128]; root = e[:20].decode('utf-16le', 'replace').rstrip('\0')
kind = KIND.get(e[80:81].hex()) if e[81:84] == b'\x10\x0c\x00' else None
fat = struct.unpack('<%dI' % (sz // 4), d[(f0 + 1) * sz:(f0 + 2) * sz]); hi = max([i for i, v in enumerate(fat) if v != 0xFFFFFFFF] or [0])
if fat[f0] != 0xFFFFFFFD or fat[ds] == 0xFFFFFFFF: w.append('FLAG the FAT does not list itself or the directory')
elif (hi + 2) * sz > len(d): w.append('FLAG the FAT lists sector %d but the file ends sooner' % hi)
if root != 'Root Entry': w.append('FLAG first directory entry is %r' % root)
if kind is None: w.append('WARN root CLSID is not a Windows Installer one')
if len(d) % sz: w.append('WARN size %d is not a multiple of the %d byte sector' % (len(d), sz))
if cut != 4096: w.append('WARN mini stream cutoff is %d, not 4096' % cut)
if 'SummaryInformation'.encode('utf-16le') not in d: w.append('WARN no SummaryInformation stream name')
if b'\x40\x48' not in d: w.append('WARN no table stream names (U+4840)')
print('\n'.join(w) or 'OK ' + kind + ', header, sizes and names agree')
python3 msi_peek.py hello_world.msi
OK install package (.msi), header, sizes and names agree
python3 msi_peek.py A1.msi
FLAG magic bytes are not D0CF11E0A1B11AE1
python3 msi_peek.py C3.msi
OK install package (.msi), header, sizes and names agree
On our 89 files it printed OK for 86 and FLAG for 3. Two of the 3 are the broken files that all three readers refused. The third is a 33,045 byte file with a short last sector, and all three readers opened it.
So a FLAG is a reason to look, and not a verdict. On the 21 damaged copies it printed FLAG for 14, WARN for 1 and OK for 6. The damage grid shows why C3 to C6 got an OK while a reader saw a change.
The repair script
The repair script rewrites the fields of the header. It writes the magic, the byte order, the minor version 62, the mini sector shift 6, six zero reserved bytes and the mini stream cutoff 4096. It takes the sector size from the major version, then pads the file to a sector.
import struct, sys
d = bytearray(open(sys.argv[1], 'rb').read())
if len(d) < 512: sys.exit('too short')
d[0:8] = bytes.fromhex('d0cf11e0a1b11ae1'); d[28:30] = b'\xfe\xff'
d[24:26] = struct.pack('<H', 62); d[32:34] = struct.pack('<H', 6); d[34:40] = bytes(6)
d[30:32] = struct.pack('<H', 12 if struct.unpack('<H', d[26:28])[0] == 4 else 9)
d[56:60] = struct.pack('<I', 4096)
sz = 1 << struct.unpack('<H', d[30:32])[0]
d += bytes(-len(d) % sz)
open(sys.argv[2], 'wb').write(d)
It changes the header only, so damage past the first 512 bytes stays. Work on a copy and keep the original. We checked the result with three readers on Linux and not with Windows Installer.
Is an MSI File Safe to Open? Looking is safe, and installing needs care
Reading the bytes of an MSI file starts nothing. Installing it is the risk, because a package can start code with a custom action. Install an MSI file only from a source you trust, and work on a copy when you only want to look.
Wikipedia notes that Windows Installer handles non-standard operations with custom actions. It adds that custom actions are normally developed in DLLs. Code is the reason to take care.
Our lab only read files. We used msiinfo, 7-Zip and olefile on 89 files and installed none. We scanned no file for malware, so we make no claim about the files in our set or about yours.
A file named .msi that does not start with d0 cf 11 e0 a1 b1 1a e1 is not an MSI file. Our check steps show the first look. For a program file, read the EXE file page.
Is the file a Linux package? The DEB file page covers the Debian package format.
Why Will Your MSI File Not Install? Eight causes, and what to do about every one
Eight causes stop an MSI file from installing, and the file is the cause in only some of them. Windows Installer reports a number. Errors 1619 and 1620 mean the package could not be opened, and the other numbers point to the system, the cabinet or the install.
Work down the list in order. The first two come from Microsoft's error list. Causes three to six come from our 21 damaged copies and 76 packages, so every fix names a copy or a count. Causes seven and eight come from Microsoft and need Windows.
What to try first
xxd -l 48 file.msi. Without d0 cf 11 e0 a1 b1 1a e1 the file is not an MSI file.
A restart is not an error. Microsoft lists 3010 as success with a restart required, and 1641 as success with a restart started. Neither number means the install failed.
How Does an MSI File Differ From EXE, MSP and ZIP Files? One package, three neighbors, compared
An MSI file is a package that stores what to install. An EXE file is a program. A setup program can start an install, but the MSI file is the database that lists the files and steps. An MSP file patches a package.
The table lists the neighbors of an MSI file. We studied MSI, MSP, MST and MSM files, and we studied no EXE, ZIP or DEB file. Their rows are short for that reason.
| Type | What separates it |
|---|---|
| MSI | An install package, a database of tables and streams, per Wikipedia. 77 of our files, and 76 opened in all three readers. |
| MSP | A patch. All 8 of ours have the root CLSID 000C1086 and Security 4, which Microsoft recommends for patches. Install one with /p. |
| MST | A transform that changes a package. Our 1 file has the CLSID 000C1082. |
| MSM | A merge module, per Wikipedia. We had 3, and 2 opened in all three readers. |
| EXE | A program. The page on EXE programs covers it. We studied none. |
| ZIP | An archive. The page on ZIP archives covers it. 7-Zip opened 87 of our 89 files as a Compound file. |
MSI or EXE
An EXE file is a program that starts itself. An MSI file cannot start itself. Windows Installer reads it, and msiexec is the command that does so. A setup program can contain an MSI file, and then two files do one job.
MSI or MSP
A patch changes an installed product, and a package installs it. Microsoft says the Page Count of a patch is Null. Ours show no value, which matches. All 8 patches also say Security 4, read-only enforced.
MSI or ZIP
A ZIP file is a folder in one file. An MSI file also stores files, but it adds tables of steps, settings and shortcuts. 11 of our 76 packages have a Shortcut table. A reader can extract the files, and the install steps stay behind.
Which one do you have
What Is the MSI File Format Made Of? The facts we could check, and where they came from
An MSI file stores a header, a FAT, a directory and streams, and most streams are tables. Facts below come from our checks of 89 files and 21 damaged copies. Sources are Wikipedia, Microsoft and the three test tools.
| Part | What we could check |
|---|---|
| Maker | Microsoft. The service was named Microsoft Installer at first, with the codename Darwin. The first release came on 31 August 1999, per Wikipedia. |
| Name | Windows Installer package, with the endings .msi, .msp, .mst and .msm, per Wikipedia. We did not look up a media type. |
| First bytes |
d0 cf 11 e0 a1 b1 1a e1. 68 of our files then read version 62 and 3, and 20 read 62 and 4.
|
| Layout | A header of 512 bytes, then a FAT, a directory, a mini stream and streams. Our example has 24 streams, 22 of them tables or strings. |
| Root CLSID | 000C1084 for a package, 000C1086 for a patch and 000C1082 for a transform. 76, 8 and 1 of our files. |
| Summary | Page Count is the minimum installer version, and our 76 packages say 200, 300 or 500. Word Count is a set of flags. Security is 0, 2 or 4, per Microsoft. |
| Tables | The package tables are streams with encoded names that start with U+4840. Our 76 packages have 11 to 89 tables, and the median is 17. All 76 contain _Validation. |
| Cabinet | A cabinet stores the files. A name with a number sign in the Media table means a stream inside. 14 of our packages store one inside and 7 name one outside. |
| Versions | The last release is Windows Installer 5.0 from 22 July 2009, per Wikipedia. 10 of our 76 packages say they need version 5.0. |
| Our tests | 89 files, 21 damaged copies, 3 readers, a check script of 22 lines and a repair script of 10 lines. msiinfo 0.103, 7-Zip 23.01 and olefile 0.47 on Linux. |
About the values we list
Facts about the layout come from our own reading of one example file and 89 test files, and from the pages we name. Microsoft's summary pages are the source for the summary values, and Wikipedia is the source for the history.
We read the Microsoft pages for the summary, the validation table, the error codes and msiexec. We did not read the full database reference. We report what we measured, and we make no claim about tables we did not open.
What we left out
We used no Windows machine. We did not install a package, use Orca, check a signature or scan a file for malware. Our readers and scripts worked on Linux, and Windows Installer can accept or refuse files that they treat differently.
All 89 files come from build tools and test folders, and many test one table or one bug. Our damaged copies come from one small file and change one thing at a time. We did not read the rules for custom actions in full.
Sources checked
For the format, see the Wikipedia article on Windows Installer and the Windows Installer overview. For the commands and numbers, see the msiexec reference and the error code list.
For the summary values, see Page Count, Word Count, Security and Template. For the tools, see olefile. The test files come from the WiX 3 repository, the WiX repository, the winget-cli repository and the remoteinstall repository.
Frequently Asked Questions About MSI Files
What is an MSI file?
An MSI file is a Windows Installer package. It stores the files, settings and steps that Windows needs to install one program. The msiexec tool reads it. The format is a loosely relational database built as a COM structured storage, per Wikipedia.
How do I open an MSI file?
Double-click it to start the install, or read it without installing. msiinfo, 7-Zip and olefile opened 87 of our 89 files. msiinfo lists the tables and the summary, and msiextract writes the program files out.
How do I install an MSI file?
Double-click it, or use msiexec /i with the path. Add /passive for a progress bar, /qn for no window and /L*V with a path for a log. These come from Microsoft. We installed no file, because our lab uses Linux.
What is msiexec?
Msiexec is the program that reads a Windows Installer package. Its options include /i to install, /x to uninstall, /a for an administrative install, /p for a patch and /f to repair. We did not test it.
What is the difference between MSI and EXE?
An EXE file is a program that starts itself. An MSI file is a package that Windows Installer reads. A setup program can contain an MSI file. We studied MSI files and not EXE files.
How do I extract an MSI file?
Use msiextract on Linux or 7-Zip. msiextract wrote files from the 14 of our 76 packages that store a cabinet inside, and from none of the others. For an outside cabinet, put the .cab file beside the MSI file.
Can I convert MSI to EXE?
We tested no converter. An MSI file is a package and an EXE file is a program, so the two are not the same kind of file. A setup program that wraps an MSI file is a new file, and we made none.
Why will my MSI file not install?
The file could be damaged, a cabinet could be missing, another install could be in progress or another version could be installed. Read the number Windows Installer prints. Then write a log with /L*V and read the failing action.
What do errors 1619 and 1620 mean?
Both mean the package could not be opened, per Microsoft. Error 1619 says the file could be missing or inaccessible. Error 1620 says it could be an invalid Windows Installer package. Read the first eight bytes.
Is an MSI file safe to open?
Looking at the bytes starts nothing. Installing is the risk, because a package can start code with a custom action. 15 of our 76 packages contain a CustomAction table. We scanned no file for malware.
How can I check if an MSI file is damaged?
Read the first eight bytes, the version, the sector size and the root CLSID, then list the tables with a second tool. Our script flagged or warned on 15 of 21 damaged copies, and 3 of those read as the original. Use two readers.
Can a damaged MSI file be repaired?
Some header damage can be repaired. Our script made 7 of 21 copies match the original byte for byte, and it fixed 4 that readers refused or split on. A cut file, a broken FAT and a changed stream did not come back.
Still Stuck With an MSI File? Where to go next, depending on what went wrong
Read the first bytes and use the check script. The cause list names what to try in order.
The kinds table names the kind, and the neighbors name the formats that look alike.
Is it an EXE file? The EXE file overview covers the Windows program file.
Is it an archive? The ZIP file overview covers the compressed archive.
Is it a Linux package? The DEB file overview covers the Debian package format.
Does the package make a shortcut? 11 of our 76 packages have a Shortcut table. The LNK file overview covers the Windows shortcut file.
Is it a file type you do not know? Browse the file extension resource library, or send it on the submit a file type page.
Do you need the format facts? Read the format part for the layout, the versions and the sources of MSI files.