Windows Installer Logging

Windows Installer log files can be very useful resources when debugging installer issues. They contained detailed information about the progress of an installation, including descriptive error information. For instructions on how to enable Windows Installer logging, check out this Microsoft support article.

Once you have created a log file, you can use the WILogUtl program from the Windows SDK Components for Windows Installer Developers to assist with the analysis of the log file. This tool can quickly identify the errors recorded in the log file and provide suggested solutions to fix the problems.

For more information on the content of Windows Installer log files, including a fully annotated log file, see Richard MacDonald’s blog post titled “How to Interpret Windows Installer Logs”.

Another source of potentially useful information when debugging installer issues is the Application event log. This log can be accessed via the Event Viewer (this can be found under Administrative Tools in the Control Panel). All event log entries related to the Windows Installer will have the Source field set to MsiInstaller. Look for such entries with a type of Error or Warning, and double-click the event to display more details.

One particular scenario where I have found the event log especially useful is for identifying what triggered a repair installation. The Windows Installer will initiate a repair installation automatically when it detects a problem with a product installation. In this case, the Windows Installer log file provides little useful information, but the event log can tell you exactly what caused the repair installation to run. Here is an example event log entry demonstrating this scenario.

Event Type:    Warning
Event Source:    MsiInstaller
Event Category:    None
Event ID:    1004
Date:        2009.06.01
Time:        13:48:48
User:        WORKGROUP\user1
Computer:    TEST1
Description:
Detection of product '{331A6A4B-593B-4577-AF26-86352AFB7F38}',
  feature 'Main', component '{CB379CF2-BD09-4aab-BC3C-649E50B3DC33}' failed.
  The resource 'C:\Program Files\My Application\program.exe' does not exist.

In the above example, the Description entry provides the important information. It indicates that the Windows Installer detected a problem with the product installation identified by the product code {331A6A4B-593B-4577-AF26-86352AFB7F38}. The problem is a missing key path resource (‘C:\Program Files\My Application\program.exe) for the Windows Installer component identified by the component code {CB379CF2-BD09-4aab-BC3C-649E50B3DC33}.

Windows Installer log files and the Application event log are so useful for debugging installer problems, that in many cases, the cause of the problem can be identified solely using this information. Because of this, I highly recommend a QA policy of always generating logs during testing, and attaching them to all reports of bugs suspected to be installation-related.

About Daniel Brannon

Daniel Brannon founded OSoSLO in 2009 to provide software tools and services for business and technology professionals.
This entry was posted in Windows Installer. Bookmark the permalink.

Leave a Reply