Q104807: HOWTO: Logging an MSI Installation

轉自http://kb.acresso.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=Q104807&sliceId=

 

Q104807: HOWTO: Logging an MSI Installation
Products
AdminStudio 7.5, AdminStudio 7.x, AdminStudio 8.5x, AdminStudio 8.6x, AdminStudio 8.x, AdminStudio 9.x, InstallShield 11.5 Express, InstallShield 11.5 Premier, InstallShield 11.5 Professional, InstallShield 11 Express, InstallShield 11 Premier, InstallShield 11 Professional, InstallShield 12 Express, InstallShield 12 Premier, InstallShield 12 Professional, InstallShield 2008 Premier, InstallShield 2008 Professional, InstallShield 2009 Express, InstallShield 2009 Premier, InstallShield 2009 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.

ModifierDescription
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 more minute 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

Instructions for using msiexec command-line parameters with setup.exe can be found in the article Setup.exe and Update.exe Command-Line Parameters.

For more information on logging, see Knowledge Base article Q105237 HOWTO: Logging an InstallScript MSI Project.

For more information on logging, see these Microsoft articles:

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章