Windows Installer databases are great for encapsulating all of the deployment requirements for an application or component into a single file. If your installer suddenly breaks however, the rather opaque nature of these files can make it difficult to figure out what has gone wrong.
This tool is a command line utility that will generate a Diff report of two Windows installer databases. It outputs XML and HTML versions and supports both MSM and MSI databases.
Recently, just as we were doing the final testing on a major software release, one of our testers found that our installer had suddenly stopped working on NT4, when in the recent past it had worked without problem. I had an MSI database that worked, and one that didn't, but what was different?
I used Orca (the MS Platform SDK tool) to look for the culprit, but there are dozens of tables in an installer database, and for a large application, some of those tables will have hundreds of records. Spelunking through that much data quickly proves painful.
Luckily, the Platform SDK also includes a VBScript file that will Diff two databases (<SDK_PATH>\Samples\sysmgmt\msi\Scripts\WiDiffDb.vbs, in case you're wondering). The output of this script, while helpful, is not especially easy to understand or navigate. And while it allowed me to track down the problem, I decided that I needed something a little better in the future.
(For the curious: the problem turned out to be an upgrade to the virus scanner on our build machine. It updated some system files that had been previously excluded from the VS.NET deployment projects that we use to build merge modules. When the version of a manually excluded dependency changes, the exclusion will magically disappear, even if the .vdproj file itself hasn't changed in months.
Microsoft, if you are reading this: if you make one change to VS.NET 2005, please allow me to disable the automatic inclusion of detected dependencies in deployment projects!)
Using the tool
Using MSIDiff.exe is pretty simple. Just provide it the path to the two databases that you want to compare, and it will generate a report for you. If you're really a fan of paging through console output, use the
Sample output in both XML and HTML format is available here.
MSIDiff <PATH1> <PATH2> [-html] [-xml] [out=<PATH3>] [-view] [-verbose]
PATH1 and PATH2 are paths to the MSI or MSM databases to compare
-html or -xml indicate what type of output to generate
PATH3 is the name of the output file to create
If not specified, the output will be created in the same folder as PATH1
with a name derived from the input files
If PATH3 is relative, it will be created relative to PATH1
-view will open the output file in a web browser
If both -xml and -html are specified the html will be shown
-verbose outputs status to the console
Points of Interest
So that's about it. I hope that this proves useful!
- 12/21/2004 - Initial release.