How do I create a log file of my installation?

来源:互联网 发布:项目管理软件 cms 编辑:程序博客网 时间:2024/04/30 13:35

For a specific setup, when launching it

Launch your setup with a command line like this:

  msiexec.exe /i C:\Path\Your.msi /L*v C:\Your.log

With Windows Installer 3.0 or above you can also add the x switch to get extra debugging information:

  msiexec.exe /i C:\Path\Your.msi /L*vx C:\Your.log

If Windows Installer crashes or hangs so that you have to kill the process, some logging information may not yet be written to the file. In this case add the ! switch to flush each line to the hard disk:

  msiexec.exe /i C:\Path\Your.msi /L*v! C:\Your.log  msiexec.exe /i C:\Path\Your.msi /L*vx! C:\Your.log

Note that this will slow down the performance of your install!

If you're using InstallShield's Setup.exe launcher, you can enter /L*v C:\Your.log in theCmdLine= entry of Setup.ini to force a log file to be created; starting with IPWI 2.03 environment variables are expanded, so you can use expressions like/L*v %TEMP%\Your.log. Other setup launchers support similar methods to specify command line arguments.

If you launch the setup from the InstallShield IDE you can specify the logging options in the Project Settings dialog.

For a specific setup, inside the .msi file

Starting with MSI 4.0 you can add the MsiLogging property to the Property table in the .msi file:

Table: Property
Column Name: MsiLogging
Column Value: voicewarmupx

You can also use voicewarmupx! to immediately flush each log line to disk.

This will generate log files named Msi*.log where * is a random number in the TEMP directory. The read-only propertyMsiLogFileLocation is set to the full path of the log file, so you could display the path or open the log file at the end of the install.

The MsiLogging property cannot be modified by a patch package (.msp). The /L command line parameter takes precedence over the MsiLogging propertry. The meaning of the flags in the value are documented in theWindows Installer SDK. The MsiLogFileLocation property is read-only and cannot be used to specify the log file location.

Globally for all setups on a machine

You can also globally turn on Windows Installer logging for a machine. To do this create the following registry entry either directly in the registry or using Group Policy, as described inMicrosoft Knowledge Base article 223300:

  [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer]
  "Logging"="voicewarmup"
  "Debug"=dword:00000007

This will generate log files named Msi*.log where * is a random number in the TEMP directory for each MSI based setup. The meaning of the flags in the value are documented in the aforementionedKB article 223300. Note that you should use this only during the trouble shooting phase because it will have adverse effects on system performance and disk space.

For a specific setup created from a InstallScript MSI projects with InstallShield

Remark: This paragraph also applies to so called "Standard" projects in Developer version 7. It does not apply to "Basic MSI" projects.

Launch your setup with a command line like this:

  Setup.exe /Verbose"C:\Your.log"

Globally for InstallScript MSI setups created with InstallShield

Remark: This paragraph also applies to so called "Standard" projects in Developer version 7. It does not apply to "Basic MSI" projects.

For InstallScript MSI Standard projects in InstallShield Developer/DevStudio you can generate a verbose log file by creating the following two registry entries:

  [HKEY_CURRENT_USER\Software\InstallShield\ISWI\3.0\SetupExeLog]
  "VerboseLogFileName"="C:\VerboseLog.log"

This method only works if the installation is started using Setup.exe, not of the .msi file is launched directly.

原创粉丝点击