Q104807: HOWTO: Logging an MSI Installation
Products
AdminStudio 10.x, AdminStudio 9.x, InstallShield 2009 Premier, InstallShield 2009 Professional, InstallShield 2010 Express, InstallShield 2010 Premier, InstallShield 2010 Professional, InstallShield 2011 Express, InstallShield 2011 Premier, InstallShield 2011 Professional, InstallShield 2012 Express, InstallShield 2012 Premier, InstallShield 2012 Professional, InstallShield 2012 Spring Express, InstallShield 2012 Spring Premier, InstallShield 2012 Spring Professional
Project Type
Basic MSI, InstallScript MSI
Operating System
All Windows
Summary

To create a log file that records the progress of the installation, you need to execute your MSI package at the command line using the /l switch. The log file can be used to diagnose the cause of failure or unexpected behavior in an installation.


Discussion

To log the execution of an MSI package you need to include /l along with one or more of the flags from the following table, in addition to any other command-line parameters you may be using. A path that indicates where the log file should go is also necessary.

Here is an example of a command line that logs everything verbosely. This provides the maximum amount of information obtainable via logging.

msiexec /i "C:\my stuff\package.msi" /l*v "d:\place for logs\package.log"

Other modifiers can be used in conjunction with the /l switch. They are listed in the following table.

Modifier Description
i Status messages - Indicates when actions are started and stopped.
w Non-fatal warnings
e All error messages
a Start up of actions
r Action-specific records
u User requests
c Initial UI parameters
m Out-of-memory or fatal exit information
o Out-of-disk-space messages
p Terminal properties
v Verbose output
x Extra debugging information--only available on Windows Server 2003
+ Append to existing file
! Flush each line to the log
* Wildcard, log all information except for the v and x options. To include the v and x options, specify "/l*vx".

Other Examples

Here are a few more examples of command lines that log installations.

Keep track of the sequence in which actions start and stop during uninstallation:

msiexec /x {00010001-0001-0001-0001-000100010001} /li "d:\logdir\package.log"

Log just the errors:

msiexec /i "C:\my stuff\package.msi" /le "d:\place for logs\package.log"

Log events that are minuter in scope than the actions and keep track of out of memory and disk space errors:

msiexec /jm "C:\my stuff\package.msi" /lvmo "d:\place for logs\package.log"

Get a list of all of the properties and their values at the end of the installation, but append it to package.log instead of overwriting it:

msiexec /i "C:\my stuff\package.msi" /lp+ "d:\place for logs\package.log"

Logging through setup.exe

If you have built a single compressed setup.exe and do not have direct access to the MSI file, you can use setup.exe's /v switch to pass along logging parameters to msiexec. Keep in mind, however, that the log still only records the execution of the MSI package. It will not track the actions of setup.exe itself or of instmsia.exe or instmsiw.exe.

Pass the logging-specific switches and parameters as an argument to /v.

Keep the following in mind when doing this:

  • There should be no space in between /v and its argument.

  • The entire argument should be enclosed in double quotes.

  • The backslash should precede any quote characters within the argument.

To duplicate the functionality of the example above using setup.exe, the following command line can be used:

setup.exe /v"/l*vx \"d:\place for logs\package.log\""

Logging in Windows Installer 4.0 and Windows Vista

Windows Installer 4.0 allows MSI logging to occur on a project-wide basis without having to use the command line or configure log parameters through the registry.  To learn more about this option, review the InstallShield Help article entitled Specifying Whether Windows Installer Installations Should Be Logged.


Additional Information

For more information on logging, see these Microsoft articles:


Related Document
Q105237: HOWTO: Logging An InstallScript MSI Project

Last Modified Date: 09-13-2012ID: Q104807