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
iStatus messages - Indicates when actions are started and stopped.
wNon-fatal warnings
eAll error messages
aStart up of actions
rAction-specific records
uUser requests
cInitial UI parameters
mOut-of-memory or fatal exit information
oOut-of-disk-space messages
pTerminal properties
vVerbose output
xExtra 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:

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值