Long story short, a Microsoft Installer – sometimes referred to as Windows Installer, or just MSI – is a relational database, that contains internal tables that define an installation: And is therefore a software installer, just like the typical ‘setup.exe’, only far more powerful. As of writing this post, the MSI format is now eighteen (18) years old, having been made generally available towards the end of 1999, and about to receive a fresh lease on life with Microsoft’s MSIX app packaging format.
So how does the MSI differ from other installation methods? In a majority of cases, a setup executable is somewhat opaque in the actions it plans to take, is not very extensible or customisable, and often do not provide many command options to customise the installation. In essence, the both EXE and MSI files contain instructions on where to place files, registry keys, configuration files (INI), Dynamic Link Libraries (DLL), shortcuts, and are used to install your desired application. However, only MSI offers more. Using a tool such as Microsoft’s ORCA, or solutions such as InstED, it is actually possible to load the MSI and view the internal database structure, including each individual registry key and file. Furthermore, using tools such as ORCA, it is possible to either directly alter the MSI tables, or create what is known as a ‘Transform’, to customise the installation: For example, rename a an applications Start Menu shortcut from “MPC-HC” to “Media Player Classic”, while keeping the rest of the installation functioning correctly. This also means that, unlike compiled/closed executable installers, an MSI is open and can be validated for potential issues – such as malware – before being installed.
But it gets better: As MSIs are essentially just a database, it can perform many handy functions that most installers can’t. A small sample of the benefits are:
- MSIs can be configured to automatically verify components and features, and perform a self-repair if anything is broken or deleted.
- MSIs can also be run in a ‘Repair’ mode, which can step through the installation and repair components if software isn’t working correctly, and it does this without performing a full install over the top (saving a lot of time).
- MSIs use APIs to register the use of DLLs, can perform isolation, and support Merge Modules, which allows the application to install without breaking existing DLLs of the same name, or orphaning files when all applications have been uninstalled. This allows MSIs to manage dependencies without the risk of clobbering dependencies for other applications.
- MSIs can be broken up into internal features, and can easily provide a user interface to install only the features desired. Better yet, via manipulation of the Feature table within the MSI – via direct editing, use of a transform, or via command-line property – you can customise the features during a silent installation.
- Moreover, you can also use transforms to create features, where an MSI might only be configured as a single feature, so that you can customise the installed components exactly: Which is very handy to install runtime components or sub-features only.
- Additionally, once you have installed software using an MSI, it is then possible to interact with that installation via commands, and this may include turning features on or off, without needing the uninstall the application or deal with graphical user interfaces to perform the customisation.
- For applications that require serial numbers and other activation steps, MSIs can be configured – again, via direct edit, the use of a transform, or sometimes just command-line properties – to automate the serialisation step when being deployed.
- MSIs, having a full database of all files and registry keys used, are able to completely remove and clean up the system on uninstall. A good MSI developer can even remove user settings and AppData if the user chooses to perform a full uninstall.
- MSIs are also excellent for patch management. Not only does the installer register Package Codes to identify whether the software is already installed, but can also register Upgrade Codes that identify the exact version that is installed, and allows the creation of Microsoft Installer Patches (MSP format) that use delta patching methods to remain as small as possible.
The Microsoft Installer is an incredibly powerful, versatile, and transparent installation mechanism. Within the enterprise, it is actually not uncommon for Software Packagers to be employed for the purpose of converting legacy installers and executable installers, into more manageable MSIs. And now, with MSIX packaging around the corner, Microsoft plans on expanding on this functionality, as well as bringing this installation power to cross-platform developers that also target MacOS, Linux, and Android.
To better understand the MSI packaging process, here’s a link you might find useful:
https://technet.microsoft.com/en-us/library/cc978328.aspx