How to enable Windows Installer logging

Windows includes a registry-activated logging service to help diagnose Windows Installer issues. This article describes how to enable this logging service.
Windows Installer can use logging to help assist in troubleshooting issues with installing software packages. This logging is enabled by adding keys and values to the registry. After the entries have been added and enabled, you can retry the problem installation and Windows Installer will track the progress and post it to the Temp folder. The new log's file name is random, but begins with the letters "Msi" and end with a .log extension. To locate the Temp folder location, type the following line at a command prompt:

cd %temp% 

Let me fix it myself

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756  How to back up and restore the registry in Windows

To enable Windows Installer logging

To enable Windows Installer logging yourself, open the registry with Regedit.exe and create the following path and keys:
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer

Reg_SZ: Logging
Value: voicewarmupx
The letters in the value field can be in any order. Each letter turns on a different logging mode. Each letter's actual function is as follows for MSI version 1.1:
v - Verbose output
o - Out-of-disk-space messages
i - Status messages
c - Initial UI parameters
e - All error messages
w - Non-fatal warnings
a - Start up of actions
r - Action-specific records
m - Out-of-memory or fatal exit information
u - User requests
p - Terminal properties
+ - Append to existing file
! - Flush each line to the log
x - Extra debugging information. The "x" flag is available only on Windows Server 2003 and later operating systems, and on the MSI redistributable version 3.0, and on later versions of the MSI redistributable.

"*" - Wildcard, log all information except for the v and the x option. To include the v and the x option, specify "/l*vx".
Note This should be used only for troubleshooting purposes and should not be left on because it will have adverse effects on system performance and disk space. Each time you use the Add/Remove Programs tool in Control Panel, a new Msi*.log file is created.

Enable Windows Installer logging with Group Policies

You can enable logging with Group Policies by editing the appropriate OU or Directory Group Policy. Under Group Policy, expand Computer Configuration, expand Administrative Templates, expand Windows Components, and then select Windows Installer.

Double-click Logging, and then click Enabled. In the Logging box, enter the options you want to log. The log file, Msi.log, appears in the Temp folder of the system volume.

For more information about MSI logging, please see Windows Help. To do so, search using the phrase "msi logging" and select "Managing options for computers through Group Policy".

Note The addition of the "x" flag is available natively on Windows Server 2003 and later operating systems, and on the MSI redistributable version 3.0, and on later versions of the MSI redistributable.

Windows Installer logging

Windows Installer handles its installations through Msiexec.exe. The logging options offered by this tool allow you to create different types of logs, depending on the information you need about the installation. These options are:
  • i - Status messages
  • w - Nonfatal 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
  • + - Append to existing log file
  • ! - Flush each line to the log
  • * - Log all information, except for v and x options
ImportantThe logging command is issued by the /L parameter. The above options can be used only after this parameter (the options cannot be used by themselves).

Create a log

The most used logging command is /L*V. This command will create a verbose log which offers a lot of information about the installation. Here are the steps for creating a log:
  • find out the path of the MSI file, for example C:\MyPackage\Example.msi
  • decide the path of the log, for example C:\log\example.log
  • open cmd.exe (you can use any command shell)
  • use the msiexec command line to launch the MSI with logging parameters
Install Log
For creating an installation log, you can use a command line which looks like this:
msiexec /i "C:\MyPackage\Example.msi" /L*V "C:\log\example.log"
The /i parameter will launch the MSI package. After the installation is finished, the log is complete.
NoteThe example command line uses the sample paths in this How-To. For your package you must use the path of your MSI file.
Note that any logging command line should have this form:
msiexec /i <path_to_msi> /L*V <path_to_log>
After you use the logging command, you need to specify the log's complete path. If you want the log to be created next to the MSI, you can specify only the name of the log file:
msiexec /i "C:\MyPackage\Example.msi" /L*V "example.log"
When the package is included in an EXE bootstrapper, the command line no longer uses "msiexec". For example, the command line can look like this:
"C:\MyPackage\Setup.exe" /L*V "example.log"
Uninstall Log
In order to create a log for an uninstall process, you can replace the /i parameter with /x. Therefore, a command line which creates a log for an uninstall can look like this:
msiexec /x "C:\MyPackage\Example.msi" /L*V "C:\log\example.log"
The package path can also be replaced by the package Product Code (it can be obtained by using the Project -> Options menu inside the project). The command line would look like this:
msiexec /x {B40D5AC5-6120-4AD6-BBD4-AF5EF7E04351} /L*V "C:\log\example.log"
When the package is included in an EXE bootstrapper and it's already installed on the machine, you can launch the installer again with the logging command. For example:
"C:\MyPackage\Setup.exe" /L*V "example.log"
This will make the package go into maintenance mode and you can choose to uninstall it. Since the package was launched with logging, an uninstall log will be generated.
Patch Install Log
You can create a log for a patch installation by using the /p parameter instead of /i:
msiexec /p "C:\MyPackage\Patch.msp" /L*V "C:\log\patch.log"
Use the EXE boostrapper
Another approach is to create a log file by using the /L*V parameters in the command line of the Advanced Installer Bootstrapper. Also, these parameters can be always passed to the MSI when the package is launched through the EXE bootstrapper.
If you want your installation package to always create a log, you can follow these steps:
  • open your installation package's Advanced Installer project
  • go to the Media page and select the Bootstrapper tab
  • check the Create EXE setup file option
  • set the MSI Command Line field to: /L*V "C:\package.log"
This way, when the user launches the installation through the bootstrapper, an installation log ("package.log") will be created automatically in the "C:\" drive.
ImportantThe command line received by the bootstrapper overrides the command line in the "MSI Command Line" field. Therefore, if you launch an EXE package with logging parameters, these parameters will be used for creating the log.

Automated logging with the Windows Installer Logging Policy

The logging policy is particularly useful for troubleshooting Active Directory/Group Policy deployments, in which case the installation is carried out without a user interface and there is no possibility to specify a command line for the MSI package.
In order to enable this option, you need to import the registry settings below. Please create a new text file with a ".reg" extension and then copy the following lines into it. After this, double click the ".reg" file you just created and answer "Yes" to the confirmation prompt.
REGEDIT4
          
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer]
"Logging"="voicewarmup"
"Debug"=dword:00000007
The .LOG file will be created in the currently logged on user's Temp folder and will have a name in the following format: "MSI*.LOG".
Note In case of a Active Directory/GPO deployment, there will be no logged on user at the time the installation occurs. In this case the log file will be created in the "Windows\Temp" folder.
ImportantThis option should not be left active since every install/uninstall operation of a MSI package will create a new log file, thus unnecessarily occupying disk space. Therefore, this option should only be used for debugging purposes.
In order to disable the debugging policy, you can delete the registry values you have previously added using "RegEdit.exe" or you can import the following .reg file as you did with the previous one:
REGEDIT4
          
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer]
"Debug"=-

Comments

Popular posts from this blog

Boot configuration Data Store --BCDEdit /set

ADSI Edit

Userenv logging (User Environment logging)