MSI Log

No Comments »

MSI-based installations are handled by msiexec.exe. This tool represents the Windows Installer command line interface and it can be used to control the installation behavior. It can also be used to generate an installation log for your package.

How to create the log

Short answer

Run an elevated command line which looks like this:

msiexec.exe /i "<package_path>" /l*v "<log_path>"

or like this:

"<EXE_package_path>" /l*v "<log_path>"

Long answer

Try following these steps:

  • find cmd.exe on your machine (you can use “Search programs and files” edit in Start menu)
  • right-click it and select “Run As Administrator”
  • type a command line which has this form:

msiexec.exe /i "<package_path>" /l*v "<log_path>"

  • instead of <package_path> use the actual MSI file path
  • instead of <log_path> write the full path (including the file name) where the log should be created, for example:

msiexec.exe /i "C:\setup.msi" /l*v "C:\setup.log"

  • press Enter to execute the command
  • run the installation
  • you can now check the installation log

If you don’t have access to msiexec.exe you can use the Windows Installer logging policy:

  • find regedit.exe and launch it
  • go to this registry key:

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer

  • make sure that the “Logging” registry entry exists and is set to:

voicewarmup

  • when running the installation a log with a name of the form “MSI*.log” will be automatically created in the Temp folder

This policy can also be enabled for Active Directory:

  • go to “Group Policy Object Editor”
  • select and expand “Computer Configuration”
  • select and expand “Administrative Templates”
  • select and expand “Windows Components”
  • select “Windows Installer”
  • double-click the Logging policy
  • select “Enabled” in Setting tab of Logging Properties dialog

How to read the log

General structure

A verbose Windows Installer log has the following structure:

  1. InstallUISequence actions
  2. InstallExecuteSequence actions
  3. InstallExecuteSequence property dump (a list with all properties and their values)
  4. InstallUISequence property dump

More information about these actions can be found in the Windows Installer Standard Actions article.

Depending on the installation process, the structure may change:

  • for an uninstall there may not be an InstallUISequence
  • for an upgrade there may be an extra InstallExecuteSequence for the old version executed after RemoveExistingProducts action

Get the information you need

An installation is just a sequence of actions, standard or custom. If you need to find information about a specific action, for example files installation, simply search that action by name (for example “InstallFiles).

If the action is scheduled between InstallInitialize and InstallFinalize, you may find it twice:

  • the first occurrence is when it’s added to the installation script
  • the second occurrence is when it’s actually executed

You can also follow the values of an installer property by searching for its name.

Folder Paths

Windows Installer automatically resolves folder paths based on the target machine configuration. This is done during CostFinalize standard action. To determine the folder path for a specific folder you have two solutions:

  1. Search for CostFinalize and see what paths it sets.
  2. Search for your folder identifier and see what value it gets.

Installed resources

A fast way of determining what was installed is searching for InstallValidate standard action. You should find a list with all features and components, each with their state and install action.

Find errors

Installation logs are usually the best way to start fixing installation problems. If you encounter an error during install you can easily find it in the log. Just search for:

Return value 3

Sometimes is just after the error log text, other times is around it. This helps because usually there is extra information about the error which can help you fix it. For example, all errors have an error code. You can check that code in the MSI error list article, perhaps I wrote about it.

Leave a Reply

*
Microsoft Community Contributor Award