Thursday, March 1, 2012


Basics of MSI Log File


An MSI log file is a text file that provides a great deal of information about an installation program during a given run on a particular system, including:

  •  Final property values
  •  Startup information for actions
  •  Status, warning, and error messages


There are several ways to create an MSI log file, including:

1. Use the /L switch to msiexec.exe, as in this command:
msiexec /i product.msi /L*v Custom.log
The characters "*v" after the /L switch indicate to perform verbose logging of every
action taken by Windows Installer. The MSI help library describes the other switches
you can use to limit the information contained in a log file.

If your release settings include creation of a setup.exe launcher, you can use the MSI Command Line Arguments setting in the release properties to pass in the /L switch to msiexec.exe, with a value such as this:
/L*v "%TEMP%\everything.log"

Note that you cannot use MSI properties in the log-file path, as properties will not be
available until after the installation has initialized. The command above relies on the
command processor expanding the %TEMP% environment variable.

2. With MSI 4.0 on Windows Vista, you can set the MsiLogging property to a string
containing the logging flags you want to use. With InstallShield 2008, you can set this using the Create MSI Logs setting in the Product Properties view. The path to the log file will be stored in the MsiLogFileLocation property.