[Updated: 4 April 2007]
If you have a problem with the Windows Installer or an MSI package you're installing, it's a sure bet that you will be told by some smart person to "enable logging". That's great advice, except ... what do you do with the log once you get it? A common technique is to open it in Notepad and scroll up and down aimlessly, hoping to spot the "cause of your problem" section. While this is a very popular approach, it rarely yields good results. In this post, I'll walk you through the contents of a typical log so that next time you have an Installer problem you'll be in a better position to troubleshoot it yourself. "Enable Logging" First things first. If you are to take your smart friend's advice, you need to know how to generate a log. There are a number of ways to do this:
Command-Line If you can install the MSI package from the command-line, even if only for troubleshooting, then this is a very easy way to generate a log. Simply use the "/l" switch during install: msiexec /i SomeApp.msi /l*vx %temp%\SomeApp.log Using the "*vx" modifier gives the most detail possible - you should always use this when troubleshooting. Registry or Group Policy If you cannot run the package from the command-line, then enable logging directly in the registry or via Group Policy, as described in KB223300: How to enable Windows Installer logging. MsiLogging and MsiLogFileLocation properties With MSI 4.0 these two properties can be set in the Property table of a package to enable logging and specify the log location. See MsiLogging Property for more details. Installer API If you are developing an Installer-aware application, you can use the MsiEnableLog API to enable logging for the lifetime of the calling process.
MSI (c) (C0:6C) [22:17:24:911]: SHELL32::SHGetFolderPath returned: C:\Users\Admin\AppData\Roaming
MSI (s) (38:90) [22:18:04:544]: Doing action: LaunchConditions
MSI (c) (E4:F0) [22:52:31:105]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (C0:6C) [22:17:24:953]: Note: 1: 1402 2: HKEY_CURRENT_USER\Software\Microsoft\MS Setup (ACME)\User Info 3: 2
Could not open key: [2]. System error [3].
Could not open key: HKEY_CURRENT_USER\Software\Microsoft\MS Setup (ACME)\User Info. System error 2.
C:\>net helpmsg 2 The system cannot find the file specified.
Simply searching for the phrase "Return Value 3" can be a quick way of pinpointing the errors in a log. This isn't guaranteed to lead to the source of a problem as some problems are quite subtle, but it's good first step. It may also break down in localised setup scenarios. Annotated Verbose Installer Log Here is an annotated Installer log to use as a reference during your own troubleshooting: Annotated Windows Installer Log (.docx) Annotated Windows Installer Log (.pdf) This log was generated by installing the Debugging Tools for Windows on Windows Vista Ultimate (so MSI 4.0). Installer logs tend to contain a lot of repeated entries. For example, all file copy operations look alike. So to make understanding the log easier most of the repetition is omitted and only useful examples of each entry type are shown; the original log contained over 5900 entries, but this reduced log contains around 1000. This is a lot less, but is still too much for a simple blog post, hence the downloadable file. Wilogutl.exe If you've used Installer logging before, then you probably read to this point thinking "why not just use Wilogutl?". It's a good question and the reason I think you should work with the logs directly is encapsulated in number 1 rule of using the Windows Installer:
Rule 1: Learn the Windows Installer Technology The importance of this rule cannot be overstated. If you only follow one rule, this is the one to choose. Microsoft Product Support often speak to Installer users who are installing packages which they created with a sophisticated high-level re-packaging tool, without any understanding of how the Installer actually works. While these tools are excellent at what they do and they abstract the user from the details on a day-to-day basis, the lack of Installer knowledge becomes a real problem when the package does not work as expected. Setup authoring is not simply about copying files. The Installer offers extensive functionality and complexity; understand it before you start authoring packages.
The importance of this rule cannot be overstated. If you only follow one rule, this is the one to choose. Microsoft Product Support often speak to Installer users who are installing packages which they created with a sophisticated high-level re-packaging tool, without any understanding of how the Installer actually works. While these tools are excellent at what they do and they abstract the user from the details on a day-to-day basis, the lack of Installer knowledge becomes a real problem when the package does not work as expected. Setup authoring is not simply about copying files. The Installer offers extensive functionality and complexity; understand it before you start authoring packages.
Wilogutl.exe Wilogutl.exe assists the analysis of log files from a Windows Installer installation, and it displays suggested solutions to errors that are found in a log file.
I won't discuss how to use Wilogutl here, but may do so in a future post.
If you have a problem with the Windows Installer or an MSI package you're installing, it's a
What richard says is true! This man knows what he blogs! Source: http://blogs.technet.com/richard_macdonald/archive/2007/04/02/How-to-Interpret-Windows-Installer-Logs.aspx
When you say, "After the user information is collected, it is time to do the setup work and the installation switches to the client process."
above. Don't you mean:
"After the user information is collected, it is time to do the setup work and the installation switches to the server process."
????
brandon, you're right, that should read "switches to the server process". I've corrected it now.
Thanks for pointing it out.
~ Richard
Based on some less-than-positive feedback, I've uploaded a PDF version of the annotated log for those who can't make use of the new DOCX format.
In case you didn't know, the Office 2007 applications can export documents in PDF (and XPS) format using this add-on:
2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS
Windows Installer log files tend to be both verbose and cryptic. Richard Macdonald of the Windows Installer
Rob Mensching, father of Windows Installer XML (WiX), blogs about why managed custom actions are a bad
If you have a problem with the Windows Installer or an MSI package you're installing, it's a sure bet
Here's a beautiful link on "how to interpret Windows Installer logs". This is a very essential
In order to efficiently troubleshoot problems involving failed setup, we need to use the setup logs.
Note: This is a very helpful Blog posting via the Msft SQL Server and Dev tools team. Kudos. In order