Click here to Skip to main content
15,860,972 members
Articles / Programming Languages / C#
Article

A Windows Installer Database Diff Tool

Rate me:
Please Sign up or sign in to vote.
4.68/5 (17 votes)
21 Dec 2004CPOL2 min read 70.1K   895   29   5
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader Starkey Laboratories
United States United States
The first computer program I ever wrote was in BASIC on a TRS-80 Model I and it looked something like:
10 PRINT "Don is cool"
20 GOTO 10

It only went downhill from there.

Hey look, I've got a blog

Comments and Discussions

 
Generalvery useful Pin
Southmountain31-Jul-15 8:52
Southmountain31-Jul-15 8:52 
QuestionNice work. Thanks. Pin
gregsohl20-Nov-14 8:27
gregsohl20-Nov-14 8:27 
GeneralMy vote of 4 Pin
Aravind Kumar K4-Feb-11 1:40
Aravind Kumar K4-Feb-11 1:40 
GeneralFantasitc! Pin
my name is jason12-Feb-07 14:22
my name is jason12-Feb-07 14:22 
GeneralThanks, great tool. Pin
Slapout29-Jan-07 9:40
Slapout29-Jan-07 9:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.