How do I create a log file for .MSI and .EXE files?
Answer
You can create a log file by either using the "/L" command line option or using the logging policy. Select the method that is best for your installation.
To use the /L command line option with Msiexec.exe:
The following list of command line options relating to the log file is from the Microsoft Windows Installer SDK.
/L [i|w|e|a|r|u|c|m|o|p|v|+|!]
Writes logging information into a log file at the specified path. Flags indicate which information to log. If no flags are specified, the default is 'iwearmo.'
i - Status messages
w - Non-fatal warnings
e - All error messages
a – Action start-up
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
+ - Append to existing file
! - Flush each line to the log
"*" - Wildcard, log all information except for the v option. To include the v option, specify "/L*v"
Example for an .MSI file: Example for an .EXE file: “C:\Program Files\My EXE.exe” /L*v “C:\Program Files\InstallLog.txt” /I To use the logging policy: • Registry Key: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer • String Registry Value: Logging • Registry Value Data: This data can by any of the following letters or any combination of them. i - Status messages
w - Non-fatal warnings e - All error messages a – Action start-up 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 ! - Flush each line to the log
MSIEXEC /I “C:\Program Files\My MSI.msi” /L*v “C:\Program Files\InstallLog.txt”
Set the following registry key to define the log file policy on the computer:
Note that you cannot use "+" and "*" for the policy.