What is MSI?
MSI is a way to install Windows software.
MSI is a free database program.
MSI is a handy tool for scripters.
A few years ago Microsoft developed a new
system for installing software onto Windows. The system is
referred to as
"Windows Installer". Software installed by Windows Installer comes packaged
in
a file with the extension ".msi".(Sometimes the MSI file is packaged inside an EXE file.)
For the purposes of this webpage,
Windows Installer and MSI are defined separately, with MSI
being the database and object model, while "Windows Installer" refers only to Microsoft's use of MSI files
for software installation.
An MSI file is actually an SQL database, for all practical purposes. Technically it's a Compound Storage File,
like a Word .doc file. But the functions available for working with MSIs present it as a simple SQL database.
A scriptable object provided by msiexec.exe (the WindowsInstaller.Installer object) is basically a simple SQL "engine",
offering an extensive set of functions for accessing and manipulating an MSI database. (The relatively limited query options, a
subset of SQL, have sometimes been referred to as "WQL" or Windows Query Language.)
Windows Installer (WI) refers to using MSI database files as the "housing" for a software installation.
An MSI file used to install software through WI contains
the software install settings and usually contains the software itself, packed inside the MSI.
Unfortunately, the Windows Installer system is extremely - even bizarrely - complex.
It uses an MSI database that contains approximately 80 tables, with extensive cross-referencing
between the various columns of those tables. The structure of MSI databases, when they are used as Windows
Installer installation files, is so complex,
convoluted and poorly designed, with data so heavily cross-referenced - and the available tools are so limited - that few
software developers using WI actually create their own installation files.
It's a rather absurd situation: Microsoft created a comprehensive software installation system
for Windows, which should have simplified the process. The Windows Installer system is
supposed to be doing all of the "heavy lifting". So there's no reason that people should need anything more
than an INI file to create a full-featured installer. Yet instead of making software installation easier, Windows Installer has made
it far more complex. Software developers end up needing
other, specialized software developers... to write special software... that makes sense of Microsoft's installer
software... in order to produce specialized software... to install their software.
The situation has become so ridiculous that Flexera Software (formerly named Acresso), the makers of InstallShield, are able
to charge nearly $3,000 for their InstallShield product, and the installer for InstallShield itself, as of 2018, is
some 430 MB! Presumably that ends up being about 1 GB of absurdly overpriced software, once the 430 MB package has
been installed on-disk... just to build
MSI packages for installing software.
Perhaps Microsoft deliberately made a mess of Windows Installer so
that InstallShield, Wise and other 3rd-party companies could stay in business. After all, if Microsoft had created a simple, intuitive
and functional system for installing software onto Windows then no one would have any
reason to pay for 3rd-party installer software, and that might leave Microsoft open to more lawsuits.
Whatever the real story
is behind the design of the Windows Installer system, as you may have guessed by this point, the downloads
and information here are not intended to help anyone use the Windows Installer system to build a software installer.
Back to Contents
Why be concerned with MSI files?
While Windows Installer is arguably of little value for
its intended purpose of installing software,
it is scriptable. That is, the Windows Installer
"object model" provides a way for script or other programming tools to access an MSI file. There are three ways
to take advantage of that design:
1) Inspecting, unpacking and/or editing software installers. Some companies package their software installations as
MSI files because it's Microsoft's "official" method. (Any company that wants to
add an official Microsoft "Approved for Windows" logo to their software packaging must use MSI installation.)
That can be an advantage for
the software customer because an MSI file is entirely transparent, given the right tools.
VBScript can be used to unpack, document, and even alter the installation parameters
of an MSI installer. You can unpack an MSI file, extract the files inside, and find out
what Registry entries will be made when you install the software. (See the MSI Unpacker below.)
You can also edit the MSI database directly to remove problematic limitations that may prevent
software installing for one reason or another. (See the MSI Editor below.)
2) Bypassing MSI limitations (for software developers).
The original inspiration for the MSI utilities here
was a problem that arose several years ago. A small, custom Text-To-Speech utility written for a blind
person required SAPI 5 Text-To-Speech support. It turned out that Microsoft had only provided two ways to install SAPI 5 TTS support.
One option was to just install the 98 MB SAPI SDK on the target machine. The other option was to study the Windows
Installer system, then remake the
utility installer as an MSI, then download 100+ MB of files in the form of "merge modules" (.msm files), and finally, figure out how
to pack the necessary parts of the necessary merge modules into the MSI. Those options were both ridiculous, just to install a handful
of support libraries that totaled about 6 MB. The sample VBScript installer for SAPI 5 TTS support (included with
the MSI Unpacker utility download) was the upshot of that dilemma. It uses the Windows Installer object model, through
VBScript, to generate a VBScript installer for only the features and/or components of a software installer
or merge module desired, without needing to install via MSI. The sample demonstrates how the MSI object model
can be used to bypass MSI limitations - and MSI usage altogether - when installing software that may require
Microsoft redistributables.
3) Using MSI files as databases. The MSI system used by Windows Installer is essentially a
free SQL database program that is installed on nearly all Windows PCs.
The scripting functionality provided through the WindowsInstaller.Installer
object enables a fairly simple VBScript to carry out all the basic functions needed to use
an MSI file as an SQL database.
The ZipFinder utility (below) is an example of how
MSI databases can be used. The ZipFinder started as a blank MSI file. VBScript
was used in combination with the WindowsInstaller.Installer object to create tables
in the blank MSI and load them with the relevant zip code and area code data. The ZipFinder
interface is a simple webpage that uses the same WindowsInstaller.Installer object, via webpage scripting, to
read from and write to the zip code database - a list of some 55,000 US zip codes.
The CodeLib
Code Sample Library (below) is another example of just how useful an MSI file can be when
used as a simple database.
Windows Installer Documentation:
The VBScript class provided here, along with the associated documentation
(included with the MSI editor) provide the basics needed to use MSI files as custom databases.
If you want more information about Windows Installer and the WindowsInstaller.Installer object, Microsoft offers
a help file. But there's a hitch: It used to be that Microsoft offered small, downloadable packets, or SDKs, for different aspects of
Windows. The Windows Installer SDK included a help file, msi.chm, along with code examples. For unknown reasons,
Microsoft have removed access to all specific SDKs. There remain only two options for documentation:
1) Microsoft online webpages. Most of the docs are there but are very spread out. If you
want to use a search engine to find one specific topic, Microsoft online docs are handy. Otherwise,
their website is essentially unusable -- rife with dead links, lacking any functional index or search capacity,
and with so little information on a given page that one could spend all day clicking links and getting nowhere.
Microsoft might well have the worst corporate website in terms of broken links. Getting a 404 server response (we couldn't
bother to redirect your request) is almost more common than not.
2) The Windows platform SDK. This is
all of the docs in one package, along
with various tools and code samples for programmers. It's gigantic. The Windows 7 SDK is
about 1.5 GB packaged. That's probably at least 3 GB unpacked! Worse, the help files in the SDK
are in the form of HKS files, which require a special reader. (HXS files are a slightly altered
version of CHM help files. The former require a reader. The latter are natively supported on
all Windows versions.) The msi.chm help file is very much worthwhile if you do any work with MSIs. The format
is amazingly complex, with numerous "exceptions to the rule". But the help docs are
comprehensive, providing an indispensable reference.
If you want to get the Windows Installer (MSI) help file.....
1) Download a full ISO version of the Win32 SDK ("Software Developer's Kit"). Watch out for the hokey "web installer" version.
The download should be more than 1 GB.
This link works, as of this writing, to get the
Win7 SDK ISO.
2) Open the ISO using 7-Zip. Inside the
Setup\WinSDKDocWin32 folder you should find 6 CAB files.
They comprise all of the Windows docs. The MSI help file is in cab3.cab. (The path and CABs might be slightly different in a different version of the SDK.)
The file names are corrupted,
but the real names can be deduced from the name format. The MSI help will have a name like
WinSDK_Msi_hxs_63E4AB21_6DAC_4A1C_A24C_25B77BC5DA10_x86.
The real file name is msi.hxs.
You can just take out the MSI help file, or you may want to get all of the help docs, in which case you'll want to unpack all 6 CAB files to
a single folder.
3) Go to the
HXS to CHM converter page
and download the converter. You'll also need to download
Microsoft's free HTML Help Workshop.
And you will need
7-Zip. The HXS to CHM Converter can be used to convert a single HXS file to a usable CHM, or it
can be used to convert all of the HXS files in the SDK. Instructions are included. Aside from installing the Help
Workshop and 7-Zip, it's a very easy process. But there are extra options worth considering. Most notably: There's an option
to remove all javascript, which often causes errors and/or limited functionality in CHMs. There's also an option to customize
the layout and format by adding your own CSS, which will override any internal CSS in the help file. That allows you to
create the CHM with whatever colors, layout style, font, etc you find most readable. (Oddly, although CHM files are a
compilation of webpages, Microsoft never thought to provide a way to customize the HTML. The only standard setting option
is to increase or decrease the font size while viewing a help file.)
Back to Contents
Who can use the downloads on this page?
Most of the code here is composed of VBScripts and scripted DHTML webpage
utilities. With the exception of the jsMSIx.exe unpacker and the jsMSI.dll COM (ActiveX) library, it is all simple text: VBScript, HTML and CSS. The downloads
here are especially designed for use by VBScripters and/or people working with Windows Installer.
But you don't have to know VBScript, HTML, or CSS. The MSI unpacker and editor,
and the zip code utility, are interactive webpage programs that might be useful to almost anyone.
If you
are familiar with VBScript, you can use the free utilities here for your own purposes
in working with MSI files, or use them as code samples for guidance in using the MSI object model.
Since these programs are composed of plain text script code, they can also be altered and new functionality
can be added as necessary.
jsMSIx.exe - Simple MSI/MSM Unpacker Program
jsMSIx.exe is a small program with no installation required and no extra files needed other
than normal system files that are pre-installed on nearly all Windows PCs. No muss, no fuss. Just
run jsMSIx.exe, browse for an MSI file, and unpack it. jsMSIx.exe can also provide MSI information, listing
files and Registry settings in the MSI without unpacking it. This is the most convenient unpacker for non-technical people.
It can be used as a normal Windows program or as a command-line utility.
For Linux: jsMSIx.exe is probably the best option for people using Linux because it does not
require support for VBScript, Internet Explorer, or COM libraries. Everything is built into a single, small
standalone program. It also has simple command line functionality to unpack an MSI and optionally
select the destination folder for unpacking. The only notable dependencies are cabinet.dll, msvbvm60.dll and msi.dll. Those files
are all pre-installed on virtually all Windows PCs and should all be installable (or have native versions)
through WINE.
View jsMSIx screenshot
Download jsMSIx (67 KB)
SHA-256:
08112aff0c9d0d7a72e06cffec843b207ef5dc652b4eef62f1c5d0dd13341659
Back to Contents
MSI Unpacker Utility - An HTA Webpage Program
The MSI Unpacker utility is a webpage program (HTA) for working with MSI and MSM Windows Installer files. It is designed
for use by anyone who might want to inspect software before installing it.
The MSI Unpacker can be used to open MSI and MSM files. It can extract files, document the contents,
and list Registry entries created by the installer. It can also detail specific parts of an installation. For
instance, if you are installing an office suite, the MSI Unpacker can tell you which files and Registry settings
are required for just the word processor program.
You can use the MSI Unpacker to inspect
software before installing, or use it to create your own, customized install/uninstall packages from the
parts of an MSI package that you want.
Scripts included with the MSI Unpacker can be used to
generate an almost-ready-to-run script containing the Registry settings required for a given MSI
program installation. That means you can rebuild an installer as a non-MSI if desired.
The download includes a sample project that uses these tools
to create an installer for the Microsoft Text-To-Speech runtime - a runtime that is not normally
available as a separate install.
This utility does not require prior knowledge of script or MSI files.
Just double-click the HTA file in the download and browse for an MSI file to unpack. But inexperienced people
may prefer jsMSIx (above). The MSI/MSM Unpacker Utility is designed for people with technical expertise
who may want to inspect an MSI file in detail or convert MSI installers to another type of installer.
The MSI Unpacker also works with the
JSDrop drop handler component,
allowing drag-drop of files onto HTAs and their shortcuts (or any other file type).
View screenshots of MSI Unpacker
Download msiext.zip (141 KB) (Last update: April, 2014. See download for details.)
Back to Contents
Simple "One-Click" MSI Unpacker Script
The Simple "One-Click" Unpacker is essentially the same thing as the MSI Unpacker described above,
but without the Internet Explorer webpage interface, and without the
extra script samples. It just unpacks MSIs and writes a log file to document the details. On Windows this is a
simple drag-and-drop unpacker, useful when you just simply want to unpack an MSI and don't need to inspect the Components, Features and other
technical details of the MSI.
To use this utility in Windows, first download msiext2.zip (below). Open the msiext2.zip download
and extract the files into a single folder. (The MSIUnpack.vbs file and the jcabxmsi.exe file must be in the same folder.)
Next, put your MSI file into an empty folder. (Unpacking can create
numerous files and subfolders, so it's best to put the MSI into it's own folder before unpacking.)
Finally, just drop the MSI file onto MSIUnpack.vbs. That's it. You'll get the unpacked software, with all files
extracted and placed in a folder hierarchy that reflects their destination folders when the software is installed. There will also be
a documentation file - an unpack log - listing included files, Registry settings
that are part of the install, etc. (Note that security/permissions problems on Windows Vista/7 may prevent the
drag-drop functionality from working. If you want to run with limited permissions on Vista/7 you may have to use
the One-Click Unpacker via command line.)
Download msiext2.zip (32 KB) (Last update: April, 2014. See download for details.)
Back to Contents
Issues With Non-MSI Files: Getting MSIs from Inside EXEs
Microsoft's general position on software installers is that they should be created as MSI
files and that those MSI files should not be "wrapped" in other files. However, there are
many types of installers and Microsoft themselves are famous for not following their
own directives. Many of their downloads are actually self-executing CAB files. Some of the
Microsoft program installers are actually InstallShield packages. (In both cases these are
.EXE files.) And in some cases an EXE might contain multiple MSIs that call each other.
If you have an unknown installer type that you are trying to open, you
might try looking at the
Tweaks and Fixes page. There is
a section there that has links to information and software. Perhaps the best software option
is
Universal Extractor,
a program that's basically just a handy GUI frontend for a collection of specialized extractor executables. (For example,
it includes the well-known INNOUNP.EXE for unpacking Inno Setup installers, IsXunpack.exe for InstallShield packages, etc.)
Universal Extractor (UE) saves the trouble of finding, collecting and updating these various tools. But UE cannot handle
MSI files in any useful way, and it will sometimes fail with other installer files due to unsupported
versions. For instance, UE can open InstallShield installers, but only if they were created with
older versions of the InstallShield program.
MSI files that are not MSI files
It seems that just about any error people can make
with an installer gets made. Sometimes MSIs are not even MSIs. An
example is some installers for Zoom videoconferencing software. The EXE
installer contains an MSI file and a second EXE installer file. Except that the MSI is not an MSI.
It's a misnamed .7z compressed file. When you try to unpack that MSI you'll get
error 110,
which means unable to open file. When you get error 110 it's possible that the problem
could be permissions, but don't rule out a corrupt installer. Check the MSI in a hex editor to
be sure it's actually an MSI. An MSI file is a "compound storage file". The initial bytes should
be
D0 CF 11 E0 A1 B1 1A E1.
How does a .7z ZIP file get mispackaged as an MSI? It's a very odd error. Maybe
the installer is deliberately designed to thwart unpacking? Maybe it pretends to package an MSI
in order to keep Microsoft happy? Or maybe it's just another bit of sloppy work by Zoom, the
people who bring you insecure video conferencing.
MSI files inside EXE files
It is fairly common to find software that installs from an MSI
file but which is packed inside an EXE file. Some recent version InstallShield
packages are designed that way, for example. If you can't get at the contents
of a given installer EXE file, it's always worth checking for a hidden MSI. Open
the TEMP* folder while running the installer. Leave
the setup window open while checking to see what the installer unpacks. If the installer
unpacks a folder to TEMP, check there for an MSI file. If you find an MSI file,
copy it to somewhere else, then cancel the install. (Setup must be left running while you
check the TEMP folder because it
will usually delete the files in the TEMP folder when it quits.) The resulting .MSI file
will be the real program installer.
* Finding the TEMP folder: It's usually C:\Windows\Temp on Win9x.
It will probably be down inside the "C:\Documents and Settings" mess on XP.
But XP+ can have numerous TEMP folders. If you're not sure, copy this
text into Notepad, save it as findTemp.vbs, and double-click the .vbs file:
Set FSO = CreateObject("Scripting.FileSystemObject")
MsgBox FSO.GetSpecialFolder(2)
MSIs Inside EXEs Get Wacky -- the 12-09 Update
As explained
above, the unpackers were updated slightly as of 12-09.
Some newer installations, especially with Windows Installer v. 4.5, seem to be using a new and rather odd
install method.
In general an EXE is not part of an MSI install. The MSI itself is the installer file. But some installs use an EXE, nevertheless. As explained in the last section, an EXE
will dump an MSI file into the TEMP folder and then run it from there. The actual program files, in that case,
are stored in a CAB file, which is usually embedded inside the MSI. The EXE is just an unnecessary "wrapper" around the MSI.
To unpack those MSIs without installing the
software, the MSI must be fished out of the TEMP folder after starting an installation. Then the installation
can be cancelled and the MSI unpacked.
With some newer installation files there is a new wrinkle. A good example is SQL Server 2008 Express
from Microsoft. The download is an EXE file. (Microsoft have never recommended EXE "wrappers" around MSIs,
but Microsoft have never been in the habit of following their own instructions, either.) The EXE in this case is not just
an MSI wrapper. It is actually a self-executing CAB file. If the download is converted to a CAB it can be seen to
contain all of the install files, named with pre-installation code names that get changed on install, plus a handful of installation files, including an MSI file. The SQL Server
install requires Windows Installer v. 4.5, yet Windows Installer is largely superfluous in the installation. When the
EXE is run it dumps it's contents into the TEMP folder, but in the process
it also unpacks the install files, copies
them to a program folder tree created in the TEMP folder, and renames them all to their correct post-install names!
Since there is no embedded CAB in the MSI to unpack, the MSI Unpackers do not find any files and the
Program Description log file written by the unpackers therefore does not list any files.
In other words, this is an inside-out MSI. Instead of being an MSI with an embedded CAB inside, the MSI is actually inside the CAB.
Microsoft's SQL Server install is not alone in using this odd method, so you need to be
aware of it for successful unpacking. You can recognize the new "wacky mode" installers because when you open the TEMP
folder you'll find not only an MSI but also a full program installation, ready to be copied to the appropriate
folders. The program folder is there just as it would end up being in Program Files if you completed the install!
So the file unpacking is already done for you. You can copy those folders/files out of TEMP
if you want to inspect them. But there is still an MSI file as well. The MSI still contains documentation of folders,
files, Registry settings, Features, Components, etc. You can run the MSI Unpacker with that MSI file to get
a log file that documents all of those things. The difference from a normal MSI is that the unpacker will not
actually unpack anything, because there's nothing there to unpack. It has already been done by the installer EXE.
The 12-09 update to the unpackers includes a change to make sure that the program files
and their paths are listed in the final "Program Description.txt" log, regardless of whether those files
were unpacked and renamed by the unpacker, or whether they were unpacked and renamed by the installer EXE.
Back to Contents
Solving Problems: MSI Requirements Preventing a Program Installation
Complications can be caused by an installer that asserts requirements.
For instance, a common installer requirement that can thwart an install, and\or thwart the unpacking
of a setup EXE file, is the demand that a particular version of Internet Explorer be installed.
This is an especially odd requirement. In most cases the software does not even use Internet Explorer!
For problems with Internet Explorer requirements, try changing the version
number in this Registry value:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Version
Also, see the MSI Editor topic below. Altering/removing install requirements is one of the uses of the MSI Editor.
A unique issue is the ".Net Framework", which is Microsoft's version
of the Java "Virtual Machine" -- a set of support files needed for software written
as a .Net program. Most software does not use .Net, fortunately. (The more recent version of the support files package is over 200MB!).
But what if you just want to see the software, and maybe you don't want to install all of the .Net support files?
For problems with demands for .Net Frameworks, if you just want to open an
installer EXE file and may not want to actually install the program in question, you can spoof
.Net support temporarily. For that, see
this file.
That link should open in your browser as text. Copy the text, paste it into Notepad or another plain text editor, then
save that as a file named
Spoof Dotnet.vbs. Note that the file extension must be .VBS, not .TXT. When you
double-click that file you will be given an option to add or remove the DotNet spoof from the Registry. Once added,
software installers will think that whatever version of the .Net Framework they want is already installed. The
script adds Registry settings that say you have all 5 .Net Frameworks. For good measure, it also tells querying
software that you have Service Pack 3 of each Framework, and version 3 of Windows Installer.
(
Caution: This script is for limited usage, for people who just want to inspect a program they are unlikely to actually
use, and who do not want to install the numerous .Net
support files. The script will record in the Registry that all 5 .Net Frameworks are installed. Likewise,
removing the spoof will remove those settings, even though you may have one or more frameworks installed.)
Back to Contents
Problems Unpacking MSIs in Windows 98
MSI files are a type of Microsoft-specific file known as a Compound File,
Compound Storage File, or Compound File Binary (CFB). OpenOffice.org and Microsoft both provide
documentation for this file type. A CFB file is a flexible format consisting of a number of segments.
The segments can represent different things, depending on the file type. The purpose of the CFB
format is simply to arrange those parts in an orderly structure that can be parsed.
MS Word .doc files, Powerpoint files and MSI files are all CFB files.
There are two major versions of CFB files currently in use: versions 3 and 4.
Version 4 was introduced with Windows 2000. Most MSIs are CFB v. 3 files; unpacking should work
on Win9x regardless of the Windows Installer version. However, there are some CFB v. 4 files
in use. (One example is the Libre Office installer.) A CFB v. 4 file will not be recognized on Win98.
Since CFB files are native to Windows itself, it is unlikely that any kind of update will solve that problem.
(On the bright side, it is very unlikely that any software packed into a v. 4 MSI file will run on Windows 9x, anyway.)
If you have trouble unpacking an MSI on Win98, the first thing to do is
to check the CFB version: Open the MSI file in a hex editor. You will find that the
first 8 bytes are nonsense, comprising the "magic" bytes, which identify the file type. After that
come 16 null bytes. The next 6 bytes should be either
3E 00 03 00 FE FF
or
3E 00 04 00 FE FF. Those are version 3 and version 4 respectively.
Back to Contents
.MSU Files
.MSU files apply only to Windows Vista and later. An MSU is an update
file. While MSUs have been tied into the Windows Installer system, an MSU is actually
not a Windows Installer file at all. It's just a CAB file. If you rename a .msu file to .cab
you can open it with any ZIP program. Inside you'll typically find more CABs. The update files
will be inside one of those CABs. (The actual content of an update will usually be
breathtakingly convoluted and overproduced, with liberal sprinklings of CLSIDs, bloated XML, etc.
It's not the sort of thing that one is likely to want to dissect.)
Back to Contents
Non-JSWare Tools For Handling MSIs
There is a lot of confusion and misinformation online in regard to options in dealing with MSI files. Basically,
an MSI is a storage file designed to work like a simple SQL database. Microsoft provides functionality (in MSI.DLL) to manage that database.
(MSI.DLL, which provides the functionality used by Windows Installer, has a dual API -- Win32-style functions for programming languages and
COM Dispatch functions for use with script. Many of the tools here are VBScript-based because the scripting API is essentially the
same as the programming API, and very easy to use.)
The JSWare
MSI unpackers are the only ones available, as of this writing, that can fully unpack an MSI and also document
the Registry settings changed when the MSI install is run.
Other options:
•
Administrative Install - An Admin install is a Windows Installer command line option using msiexec.exe.
It extracts files for multiple network installations, running the steps in the
AdminExecuteSequence, if present, rather than the
InstallExecuteSequence.
That's not quite the same thing as unpacking. Look it up in the MSI docs if you think that might be of interest. (Also note that an Administrative Install is
a restricted operation. It can only be done with Administrator status. And it is not "supported" in all MSIs.)
Some software programs available that claim to unpack or extract from MSI files are actually just graphical "front-ends"
for doing an Administrative install. They simply execute an msiexec command line so you don't have to type. (An example of that is a program named only "MSI Unpacker".)
•
Less MSIErables - This is a free, "open source" program that allows one
to see files in an MSI and also unpack the program.
Pros: Less MSIErables has an attractive, polished interface, it's easy to use, and it works. It also provides the option to
extract only one specific file from an MSI installer.
Cons: Less MSIErables does
not provide information about Registry settings.
And it has gigantic dependencies. (Other files required for it to work.) Less MSIErables is actually a simple wrapper GUI that requires the .Net Framework and a set of
Microsoft libraries known as "Wix". So Less MSIErables is a multi-level wrapper around wrappers. (.Net
wraps the Win32 API. Wix is a set of wrapper libraries around msi.dll. Less MSIErables wraps the whole mess.) The latest .Net
Framework is about 500 MB! Neither .Net nor Wix is necessary for processing
MSI files, so unless you already have .Net and Wix installed, Less MSIErables will add a big pile of bloat to your system for no reason.
•
Universal Extractor - Universal Extractor is useful for unpacking some installer
files, but it is actually just a convenient wrapper around a number of other unpacking tools. It works well with some types of installers and
not so well with others. At
last count Universal Extractor had 3 different methods to unpack MSI files and none of them actually worked.
Caution: Universal Extractor development was discontinued with version 1.6. More recently,
a Russian author has been releasing an "unofficial" updated version. The Russian version does not appear to be malware,
but it is suspicious. First, the installer is encrypted and password protected. So it's an installer for an installer unpacker
which is, itself, impossible to unpack! Second, the Russian version is using JSWare MSI unpacker files without notification
to us and without permission. Those files have also been altered significantly. Third, the new version also offers to unpack MSIs
using MsiX or 7-Zip. As explained below, those do not work. The Russian author clearly does not understand the software
he's using. As with the original version of UE, at best the new version is just a repackaging of software from
other sources. We do not recommend running the installer for the "unofficial" version (post 1.6.1) of Universal Extractor.
•
7-Zip - Many people mistakenly believe that the free compression program 7-Zip can unpack
MSI files. Even the
Wikipedia page for Windows Installer
says so. 7-Zip cannot unpack MSI files. Technically, 7-Zip can extract content from MSI files. If you open an MSI file with 7-Zip it will appear to
show you the content, but what you'll see
are binary versions of the database tables, along with internal resources such as icons displayed during installation. None of those items are
of any particular value. It's analogous to dismantling a car by cutting it into slices.
The slices do represent parts of the car, but they are not relevant parts.
If the MSI contains a CAB file, 7-Zip can be used to extract that
from the MSI, but then all you have is a CAB full of files with incorrect names, because
part of the silliness of MSI installers is that, "by tradition", program files in the package are always given nonsense names.
The only way to find the correct names and install paths of files in an MSI CAB is through a circuitous cross-referencing
of multiple MSI database tables. That's what an MSI unpacker does.
So the
seeming ability of 7-Zip to unpack MSI files (or any compound storage file format, such as DOC and PPT) is
just a source of confusion with little or no value. (See the
CFB file explanation above for more info.)
•
MsiX - Some people think that MsiX is an MSI unpacker. It is not. It is a small command-line utility for
working with embedded binary files in an MSI or an MSP patch file. MsiX can extract resources such as BMPs, ICOs, etc. from the _Streams table,
and it can extract items from the _Storage table. In general these items are not relevant except to the author of the
installer. And the latter table is generally only relevant with MSP files. If you want to extract resources see
below. Extracting all files from the _Streams
table is a simple operation in script.
Of all the options above, Less MSIErables is the only one that can really unpack
an MSI and put the extracted files into a folder tree that represents how the program will be configured if you
install it.
Overvaluing Open Source:
It is notable that the programs listed above are all so-called "open source software" (OSS). There is
a strong tendency among many people to idealize OSS. OSS has developed into somewhat of a club, such that it may sometimes be
recommended even when it can't do the job required, simply because OSS followers are not aware of anything except OSS. Even
apparent experts at sites such as
InstallSite.org
and
Wikipedia make that mistake. (Both sites
mistakenly list 7-Zip as an MSI extractor tool.)
Basically, OSS means that the software's source code is available. That can be helpful to programmers, but most people can't use or read the
source code. And in many cases the source code is not particularly useful. In the cases of
Less MSIErables and
Universal Extractor,
for example, both are lightweight wrappers around other software, so their source code doesn't provide anything much of value.
(
7-Zip, by contrast, is a very capable and highly regarded program. It just doesn't happen to work for unpacking MSIs.)
For anyone who wants "source code", the VBScript unpackers here offer more complete
source code than any other tools available. As script, all the code is in plain text. Anyone is free to reuse that code as they like.
The scripts come with an extra, small program required to extract from CAB files, but the actual processing of MSI files is done
entirely through MSI.DLL (the basic Windows Installer library) with VBScript. Using MSI.DLL is the most direct method. It
is
Windows Installer. There is no
need for bloated extra dependencies such as .Net, Wix, or 3rd-party software.
For interested programmers there is a Windows Installer help file as part of the Windows SDK.
That documents the two sets of methods for processing MSI files: The COM automation object model using
WindowsInstaller.Installer and the Win32 functions. The JSWare tools here either demonstrate the COM automation
objects (VBScript and HTA) or use the Win32 functions (jsMSI.dll, jsMSIOps.exe and jsmsix.exe). If you have sample script code it's not difficult
to go from there to the Win32 API functions in MSI.DLL. That is, once you know about how MSIs work and how the
Windows Installer object model works, the API versions of the same methods are fairly self-explanatory.
Back to Contents
MBase - MSI Database Editor
The MBase MSI Editor is a database editor program, created as a webpage.
More specifically, it's an HTA program. (If you don't know what that is,
see explanation below.)
The editor can display the content of MSI files and allows you to add or remove tables, rows and columns.
You can also edit individual row cells, export the text
of specific tables or all tables, and export, insert, or overwrite embedded MSI CAB file data streams.
All through a convenient graphical interface
(Embedded CABs are the most common way to store the actual software files in an MSI/MSM installer file.)
MBase
can be used to work with MSI software installation files, but it's designed to be more adaptable
than that. It can also be used to create your own databases from MSI files, designing the tables
for your own specific needs rather than using the standard MSI tables. (See the ZipFinder sample below.)
MBase can also be used to adjust poorly designed software installers.
Example: As mentioned in the introduction above, a surprising number of software installers insist on having a
specific version of Internet Explorer, even though they don't actually require a browser at all. Hewlett Packard printer software
is one example of that. (Actually, much of the software and many of the driver installers that come with PC hardware seem to be slipshod
productions done on a tight budget. HP is not alone. But writing a printer driver installer that requires a specific browser version
is inexcusable stupidity that never should have made it into the final product.) A nonsensical IE requirement is especially
a problem because updating Internet Explorer is a tricky business that can often go wrong.
IE version requirements and other
similar installation problems can often be bypassed with MBase. If the software is installed via MSI, you can just open to the LaunchCondition
table to check for installation requirements, and change MinVersion / MaxVersion
fields in the Signature table to alter install requirements. (Or even better, just remove all rows from the LaunchCondition and/or
InstallCondition tables, if they exist, in order to remove installation restrictions.) Of course, that won't make
software run on Windows 98 if it was written only for Windows NT systems, but it may at least
save you from wasting unnecessary time with badly designed MSI installers.
View picture of MBase MSI Editor
Note The MSI Editor will also work with the
JSDrop drop handler component,
allowing MSI files to be opened in the editor by dropping them onto the MSI Editor program file or its shortcut.
Download MSI Editor (210 KB)
Compatibility note: The MSI-MSM Unpacker should display and function well on all Windows
versions from Windows 95, with any version of Internet Explorer from 5 up. If you find any dysfunctionality,
please see the note below
about differences in IE versions and Windows versions.
Back to Contents
ZipFinder Zip Code and Area Code Database Program
ZipFinder is a webpage program that uses an MSI database file to hold and access approximately
55,000 US zip codes and most area codes. You can enter city/state names to return a zip code, or enter a zip code
to return the respective city and state. You can also enter an area code to find its location.
ZipFinder does not require any knowledge of script or webpages. Just download
the zcodes.zip file and extract the contents. You will have a folder named "ZipFind". Put the
folder anywhere, then create a shortcut on the Desktop going to the ZipFinder.hta file inside the
ZipFind folder. Double-click the shortcut to find zip code and area code information.
View picture of ZipFinder
Download zcodes.zip (678 KB)
(Note to scripters/programmers: ZipFinder is designed to be an easy-to-use utility,
but it also constitutes a sample program demonstrating the use of MSI files as SQL
databases. The download comes with a copy of a VBScript class for working with MSI SQL functions, and it
includes a copy of the script that was used to create the zip code database.)
Back to Contents
Script to Edit MSI Files: Change installer window appearance and add information
This is a single VBScript that can do two things:
1) Change the background picture in an MSI installer "welcome dialogue" window.
(The window that shows first when you install software from an MSI file.)
2) Add custom notes and a list of file versions to the welcome dialogue window of an MSI file.
Adding custom notes provides a way to conveniently
store installation information in an MSI file. For example, you might save information about date installed,
or info. about problems you had with incompatible programs,
or the URL of drivers that you'll need when you install this package,
etc.
What the custom notes function does is to first add a scrolling text box (actually a "RichEdit" control)
to the upper left of an installer's "Welcome dialogue" or splash screen window (provided that the installer
includes a "welcome dialogue"). It then provides an
option to permanently store your custom notes text in the text window. Third, it searches the MSI
for files with version numbers, such as EXE and DLL files. Then it adds a list
of those files, along with their version numbers, to the same RichEdit text window.
The result is that when you open the MSI file later, the first window shown will
contain any notes that you chose to save, and you will have the opportunity
to check what versions of which system files the installer is likely to change on your system.
In other words, the text window serves as your own, custom "README" file, built into
the installer itself.
Download msiops2.zip (6 KB)
Back to Contents
jsMSI.dll and jsMSIOps.exe - A Component for MSI Programming
jsMSI.dll is a component that provides the functionality of the 1-click unpacker
and the MBase MSI class in a compiled library. jsMSIOps.exe is the exact same thing, but compiled as an
ActiveX EXE, which allows it to run on 64-bit Windows without complications.
jsMSI.dll/jsMSIOps.exe provides a simplified API, for both script
and compiled software. It wraps the awkward and error-prone SQL syntax of Windows Installer, as well as the
unnecessary abstruseness of the overall design, providing simple, straightforward Win32-style functions instead: ImportTable,
RemoveTable, GetValue, SetValue, AddRecord, RemoveRecord, etc. Example: AddRecord("TableName", "Column1Value, Column2Value, Column3Value, Column4Value")
jsMSI does not really add anything that can't be done with the various JSWare scripts
and HTAs. It just uses the more efficient Windows Installer API and wraps the whole thing in a
single neat package. There are almost 50 functions here. No SQL needed. No superfluous XML nonsense.
No need to deal with the verbose code mess of getting View objects, looping through Record objects, etc.
jsMSI includes the following methods (by category):
jsMSI also includes built-in CAB operations. Sample scripts in the download
include a basic unpacker, demonstrations of getting and setting table values, demos of adding and removing tables and records,
and a drag-drop script that combines several jsMSI operations to replace a given file in an installer package. (Find the file,
extract the CAB, rebuild the CAB using the new file, re-insert the CAB in the MSI, and update the File table.)
Requirements and Notes: jsMSI.dll should run without problems on Win98/2000/ME/XP/2003/Vista/7/8.
But on Vista/7/8 there may be issues connected with default permissions settings. If you have any problems with jsMSI.dll on
Vista/7/8, please be sure that you have ruled out problems with Vista/7/8 permissions before writing to JSWare for help.
These components should also run without problems on Windows 10, but have not been tested.
For 32-bit Windows or 32-bit software on Win64:
Download jsmsi.zip (125 KB)
For all 32-bit or 64-bit configurations:
Download jsmsiops.zip (108 KB)
Back to Contents
Replacing a File Inside an MSI
A significant number of people end up at this webpage because they want
to replace a specific file within an MSI. In other words, they want to leave an installer intact
but replace or update one file inside the installer. That typically requires extracting the CAB
file, extracting the CAB contents, building a new CAB, and replacing the CAB into the MSI.
Additionally, there will usually be at least one or two edits required in the MSI database to update
the file size, perhaps file version, etc.
There is not actually a separate tool here for doing the job of replacing a file, but the
jsMSI.DLL download (above) includes a sample script to do the job.
The comments at the top of the script explain the details. Download jsMSI.DLL, look in
the sample scripts folder, and find the script named
ReplaceCABFile.vbs.
(Note: The file-replacer script is written to work with an MSI that contains a single CAB. In the
case of a very large installer that contains spanning CABs, the script would need to be edited,
adding a step to identify the relevant CAB file.)
Back to Contents
Extracting MSI Resources
This is not useful for most people, but some may be interested. The script here
extracts binary resources from an MSI/MSM or MSP file. Resources are not program files. They are binary files,
such as bitmaps, icons, or embedded DLLs and EXEs, used by the installer itself during setup.
Resources (streams) in an MSP file are usually CABs, containing files for a software patch.
Download msires.zip (4 KB)
Back to Contents
Geo-location Database
This is a perfect example of how useful the simplicity and efficiency
of MSI databases can be. It uses an MSI to hold geo-location data, for translating IP
addresses to their location.
Example: 198.203.177.177 < - > Plymouth-MN-US
This product includes GeoLite2 data created by MaxMind, available from
http://www.maxmind.com.
MaxMind is a company that creates and sells geo-location tools.
They have a free version of their worldwide IP-to-city database. The scripts
in this download can be used to convert the MaxMind CSV files to MSI tables,
which are then imported into an MSI file. There are nearly 3 million entries in
the IP table and nearly 100,000 in the location table, yet a query to get the
location of an IP address is almost instant. The download includes detailed
instructions and also includes sample code for querying the database.
Download mmgeo.zip (20 KB)
Back to Contents
Email Base - MSI Database For Email Backup
Another handy use for MSI database files. This is an HTA program
that serves as a program to fill MSI files with email for backup, then easily and
quickly access, search, read, or extract attachments from those emails. You can
store as many MSIs as desired: One for each year's email, one per account, etc.
For more info and a screenshot see the download page description
here.
Back to Contents
CodeLib Code Storage Database
Codelib is a code library database for storing code samples, snippets, type libraries, etc.
It uses an HTA with an MSI file "backend" to provide a searchable, organized storage system.
Use it to store large files or small snippets. For further information about CodeLib see
the
CodeLib Listing on the Scripts Page.
MSI-SQL VBScript Class with Documentation
The MBase MSI Editor and the ZipFinder utility both come with a VBScript class
for working with MSI databases. This download is that class plus documentation
about how to use it.
The MBase class provides a number of functions for working with
MSI databases. It provides several functions specific to MSI, and it also provides
a number of SQL-related functions. With the MBase class there is no need to construct SQL query strings.
Instead, the SQL calls can be made like standard Windows API functions. For example,
the function:
GetSelectValues(TableName, ColumnName, ColumnToCompare, ValueToCompare)
will return an array of all values in a given table column, where the value in
ColumnToCompare
matches
ValueToCompare. In other words, the MBase class lets you use the basic functionality of an
MSI database without needing to learn SQL query language, and without having to fiddle around with the tedium of composing
query strings with compound nested quotes.
Download clsmbase.zip (59 KB)
Back to Contents
Technical Notes Regarding IE7+ and Windows Vista/7+
Internet Explorer 7+
You should not have any problems using the JSWare HTA tools with any version of Internet Explorer later than IE4.
The MSI tools here that use Internet Explorer windows (combined with VBScript and the IE Document Object Model)
are HTAs. They have been written using IE5 or IE6. They have been tested with IE5, IE6, and to some extent with IE8.
All of these HTAs are written in what Microsoft calls "quirks mode". That means that they should look and act almost identically
in any version of IE. You should not have any problems. However, Microsoft has broken compatibility with each version
of IE and quirks mode may not be perfect when dealing with the complex webpage functionality needed for the JSWare MSI tools.
If you have any problem (for instance, the program interface not fitting properly into the window) then see the help for tips.
You can also send an email if you like. (Please describe the exact problem, the Windows version and the IE version
with any such bug reports.)
Windows Vista/7/8
The MSI tools here should work without any special requirements on Windows
95/NT4/98/2000/ME/XP/Vista/7/8, provided that the installed version of Internet Explorer is at least v. 5. However,
Windows Vista/7/8 is designed with complicated restrictions that can cause problems with any software.
If you have any problems with these MSI tools, please feel free to write. But please do not write asking
for help about permissions, security, so-called "virtualization" issues (whereby Windows blocks you from
accessing a file but pretends otherwise) or any of the other problems specific to Windows Vista/7/8 restrictions.
The MSI tools here should work without problem on Windows 8, but none of them will work in the Metro tile window.
Metro is an entirely new, restricted "sandbox" system, designed for running "swipe and smudge" trinket apps and games
used on tablets and phones. Metro tile buttons are the new interface for Microsoft online services (one could think of it as the AOL walled garden for highspeed),
which Microsoft is
trying to market by imposing the Metro screen on Windows 8 PCs. To use normal
Windows software on Windows 8 one must hide the Metro interface
and work in "Windows mode" with the normal Desktop interface.
Vista/7/8 Security Problems
Windows Vista/7/8 really only comes in one basic version. The differences between versions
are differences in what "features" are included, not in the product design. All versions, including
the Home versions, are designed to function as corporate workstation PCs, with limited rights
granted to the person using the PC. The person who installs the system is what might be termed a "fake administrator".
A fake administrator is an oxymoronic status that Microsoft cooked up with Windows Vista.
That person has the status of being in the Administrator's group, but without Administrator rights. (The difference
between a fake administrator and a common "user", is that the fake administrator will be shown nag windows
in some cases, giving them the possibility to "elevate" their rights for a single operation.)
Fake admin. status can result in numerous problems and confusion when trying to run software or access
files. A fake admin. account normally has very few rights, so you may have trouble using the various MSI utilities.
A notable example of the problems created by Vista/7/8 security limitations is that without
full admin. rights you cannot drag-drop a file onto a VBScript (.vbs file). The VBScript requires admin. rights
to run, and there is no way to get those rights in a drag-drop operation. So the Simple "One-Click" Unpacker
is not so simple on Vista/7/8. Without admin. rights it can only be used from the Run window or a command prompt.
If you want to have free reign to do as you like on your PC -- like you probably had in the past with Windows
95/98/2000/ME/XP -- you need to activate and use the only real Admin. account available on Vista/7/8. To do that, open a
command prompt using the "Run as Administrator" option. If your fake Admin. account has a password
then type:
Net user administrator password
where "password" is your account password. Hit Enter. Then type:
Net user administrator /active:yes
and press Enter. After rebooting, the "Administrator" account, which is a real administrator,
will be active and will show at the login screen. You can then adopt the "Administrator"
account as your normal login and be done with the Vista/7/8 restriction hassles. If you
ever want to remove the Administrator login option, just type the following in the Run box:
Net user administrator /active:no
Back to Contents
A Note to Non-Technical People
Some people may have arrived at this webpage because they want to just see inside
a .msi file, or want to know what the file extension .msi means. The short explanation of that is that
an MSI file is used to install Windows software. Some software comes in an EXE file. Some comes
in an MSI file. And sometimes it's an MSI inside an EXE.
A software installer file, whether MSI or EXE, generally contains all of the
files for the given software program. It also contains some method to copy those files out,
create shortcuts on the Start Menu, etc.
If you are here because you would like to inspect the contents of an MSI file
before installing, you probably want
jsMSIx.exe. With that
you can simply browse for an MSI file and click a button to have it unpacked.
What are "HTA webpage programs" and what do I do with the downloaded .zip file?
Most of the downloads here are not "normal" software programs. They are actually
composed of webpages and/or script. (Script just refers to executable programming language that
is in the form of text rather than being compiled into an EXE file. Script is what allows webpages to be interactive.)
Some of these programs run in an Internet Explorer window. The method is
similar to the way that webpages online can be interactive. But a webpage offline, running on your
own PC, can do much more. (In other words, the MSI webpage utilities are like the famous "cloud" Internet-based programs
that everyone keeps talking about. But they have the added advantage of not being in "the cloud". They
reside on your own PC, even though they run in a browser. So they avoid the limited functionality and security problems
of "cloud computing".)
An HTA file is just a webpage file designed to run as an interactive program in
Internet Explorer. For all practical purposes, an HTA program is just a webpage in Internet
Explorer that is not limited by the restrictions needed for online security. The fullscale MSI Unpacker and the MBase MSI Editor (above) are both HTA
programs. They work in much the same way as a normal program, but they are actually composed
of webpage code (HTML/CSS) and script code (VBScript). Designing the programs that way
is easier than creating a "normal" program with an EXE file. Using an HTA also means that everyone
can read and edit the code that actually makes the program work. So people who know how to script can
add their own functions or changes to the code. At the same time, a "webpage program" is not necessarily
limited in its functionality. The MBase MSI Editor (above) is comparable in functionality to
the "official" Microsoft MSI editor, named
Orca. (The big difference is that with the
MBase MSI editor you don't have to register with Microsoft, download gigantic chunks of the Windows SDK, or
allow the installation of Microsoft's WGA spyware in order to get the program.)
The downloads here do not install like a typical program. Rather, each download is a ZIP file
containing a compressed folder full of files. To use the downloads, open the .zip file and take out the
main folder.
If you do not have a program to handle ZIP files then when you double-click the ZIP file download
it will probably appear to open as a normal folder window. In that case, to remove the folder full of files from the ZIP file, just
drag it out of that window and onto the Desktop. Then close the "fake folder window". Each download has an
information .txt file in the main folder that provides
basic instructions.
"Yikes! Norton says these files might be dangerous!"
You might get a security warning from anti-virus software when you
use the downloads here. VBScript and HTA files are mainly used by network administrators,
programmers, etc. The average PC user does not know about them. At the same time, anti-virus
programs are fairly simple and "dimwitted", on the lookout for "unlikely" behavior. Therefore, some anti-virus programs
have been designed to be suspicious when
any .hta
or .vbs file runs, on the presumption that it might be a virus file downloaded in email. If you see a warning
from anti-virus programs you will need to select the option to "Allow this script to run."
Anti-virus software might also flag JSWare EXE files. In one case,
Avira
anti-virus tagged the JSWare MSI unpacker as "generic" malware. In tests it also tagged 6 of our
other EXE files as the same malware!
Attempts at communication with the Avira people to point out their error only resulted in useless, "thank you for your interest", robo-email responses.
The EXEs had to be recompiled until Avira stopped complaining!
Avira may not
be worse than other companies. They're producing an outdated product that most
people are unwilling to pay for, so it's not surprising that their product is limited in
its efficiency and that their customer support is non-existent. If you find any problems
with anti-virus or "anti-malware" tools complaining about JSWare software, feel free
to
send an email
with the details. We can probably fix the problem.
Back to Contents
Update History
General changes are explained here. See the downloads for more specific update notes.
The most recent updates to tools here were in 2014. The general functionality
hasn't changed much with various updates, but some updates have been necessary to come
up with methods suitable for use with faulty MSI files.
There are numerous rules related
to how an MSI can be built. Oddly, the people who make the faulty ones seem to be the people
who should know better. We have come across two faulty MSIs in the past that the JSWare tools
failed to unpack properly. One was part of Microsoft's Network Monitor package. (NetworkMonitor_Parsers.msi)
The other was created by a well known coding expert and Microsoft MVP. Both required changes to
the JSWare tools to work around errors in the MSI structure. (Technical details are in the downloads.)
If you come across an MSI that JSWare tools cannot unpack, feel free
to
send an email with a link
to the MSI. We should be able to determine the problem.
Related Update News
The HTA tools (MSI Editor and MSI/MSM Unpacker) work with
the
JSDrop drop handler component.
If you install JSDrop it can be used to customize HTA file drag/drop (or any other kind of file). The HTA "scripting object" also
has a
commandLine property. Yet HTAs do not normally have what's known as a "drop handler", so dropping
files onto them doesn't work. By using JSDrop one can drag/drop files onto any HTA and process the command
line as one might with a VBS file. JSDrop is a free component for use on 32-bit Windows systems.
Back to Contents