Q104807: HOWTO: Logging an MSI Installation

来源:互联网 发布:淘宝怎么更换手机号码 编辑:程序博客网 时间:2024/04/28 23:23

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

 

Q104807: HOWTO: Logging an MSI InstallationProducts
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 ProfessionalProject Type
Basic MSI, InstallScript MSIOperating System
All WindowsSummary

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.

ModifierDescriptioniStatus messages - Indicates when actions are started and stopped.wNon-fatal warningseAll error messagesaStart up of actionsrAction-specific recordsuUser requestscInitial UI parametersmOut-of-memory or fatal exit informationoOut-of-disk-space messagespTerminal propertiesvVerbose outputxExtra 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:

  • 314852 How to Enable Windows Installer Logging in Windows XP
  • 223300 How to Enable Windows Installer Logging
  • Command-Line Options

 

原创粉丝点击