Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

A Windows Installer Database Diff Tool

0.00/5 (No votes)
21 Dec 2004 1  
A command line tool that generates XML and/or HTML Diff reports of two Windows installer databases.

Introduction

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.

Background

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 -verbose flag.

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!

History

  • 12/21/2004 - Initial release.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here