cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Logging an MSI Installation

Logging an MSI Installation

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.

Synopsis

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.

Logging a Silent Install

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

Related KB Articles

See Logging An InstallScript MSI Project.

Additional Information

For more information on logging, see these Microsoft articles:

  • 314852: How to Enable Windows Installer Logging in Windows XP
  • 223300: How to Enable Windows Installer Logging
  • 2545723: How to Enable Microsoft Installer logging and Verbose logging to gather additional troubleshooting Information
  • Command-Line Options: Command line options for msiexec.exe
Labels (1)
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jan 31, 2023 05:22 PM
Updated by: