windows-installer - 在没有任何命令行参数的情况下为 MSI 安装程序启用安装日志

标签 windows-installer

如何在我的 MSI 项目中启用日志记录并设置 MsiLogFileLocation ?现在我正在运行我的 setup.msi使用命令行参数:

msiexec /i install.msi /l*v InstallLog.log

我想记录我的工作总是只是运行 setup.msi没有任何争论。有没有办法做到这一点?

最佳答案

From the MSI SDK: "You can enable verbose logging on the user's computer by using Command Line Options, the MsiLogging property, Logging policy, MsiEnableLog, and EnableLog method".

Short Answer: So add the property MsiLogging property to your MSI's Property Table and maybe use "vp" as value (without the quotes).



Hot Debugging Tip: Search for "value 3" in the log file to find errors as explained by Rob Mensching (Wix & Orca author). MSI log files can be overwhelming otherwise. See more on log-interpretation below (yellow section).


  • Similar answer
  • On the MSI logging switches and content

  • 烧掉 :WiX Burn Bundles( setup.exe 启动器)有自己的日志结构(除了上面描述的 MSI 特定的日志)。换句话说,MSI 文件有它们的日志记录,而 setup.exe 燃烧发射器有他们的。
  • See this answer , 和 from Rob Mensching himself (WiX仁慈)。
  • https://support.firegiant.com/hc/en-us/articles/230912407

  • 快速日志记录(详细) :来自 的最简单的详细日志记录cmd.exe .
    msiexec.exe /i C:\Path\Your.msi /L*v C:\Your.log
    
    快速参数说明 :
     /i = run install sequence 
     /L*v C:\Your.log = verbose logging at specified path
    

    调试日志(详细) :高级、缓慢的日志记录以获取最大的详细信息。
    msiexec.exe /i C:\Path\Your.msi /L*vx! C:\Your.log
    
    快速参数说明 :
     /i = run install sequence 
     /L*vx! C:\Your.log = verbose debug logging at specified path
    
     The x adds extra debugging information, and the ! disables the log buffer.
     This means there is no lost log if there are any crashes.
    

    所有 MSI 软件包 - 全局日志记录(策略)
    是的,你 enable logging globally on the machine 通过设置适当的注册表项。启动的每个 MSI 将导致在 中创建一个具有临时名称的日志文件。 TEMP 文件夹。按更改日期对文件列表进行排序以获取最新的文件列表。
    注册表项和值 :实际的注册表设置:
    [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer]
    "Logging"="voicewarmup"
    "Debug"=dword:00000007
    
    操作指南 :请参阅 installsite.org 中的此常见问题解答条目,“|Globally for all setups on a machine”部分:http://www.installsite.org/pages/en/msifaq/a/1022.htm对于确切的程序。
    单挑 (技术细节): This is a very technical problem that may have a bothersome and highly unexpected pragmatic effect .此全局日志记录的副作用是任何 Session objects您使用 MSI-API 从脚本实例化还将在 TEMP 文件夹中创建一个日志文件。如果您 iterate all packages and instantiate a session object,这可能会导致在 TEMP 文件夹中创建数百个日志文件。 . 同样在事件日志中 (大系统管理员不行!)。非常具体的问题,但只是指出它。临时文件夹和事件日志的清理“解决”了问题——或者更好——只是避免创建 session 对象。请注意,您的部署工具可能会意外地实例化 session 对象。也许在启用日志记录后检查,这样你就不会在网络范围内遇到这个愚蠢的问题。

    特定于包的日志记录
    除了全局设置和策略之外,您还可以通过属性或自定义操作自定义每个包的日志记录,或者仅通过 指定选项和日志记录位置。 msiexec.exe 命令行 .
    命令行 :最简单的形式:msiexec.exe /i C:\Path\Your.msi /L*v C:\Your.log . msiexec.exe command line 的文档(查看开关部分: /L )
    属性 : 您可以设置MsiLogging property在每个包中自定义日志记录。 MSI 属性 MsiLogFileLocation保存日志文件的路径。如果要在安装后打开日志,请使用此选项。
    自定义操作 : 你可以调查 Installer.EnableLog method MSI-API从自定义操作自定义特定 MSI 的日志记录行为。更多:Windows Installer Logging .

    解释 MSI 日志文件

    On the topic of interpreting log files: How to interpret an MSI Log File.

    Direct Link: Direct PDF Link to Robert Macdonald's log guide (resurrected from Wayback).

    Find Errors: And, as stated above: search for "value 3" in the log file to find errors as explained by Rob Mensching (Wix & Orca author). MSI log files can be overwhelming otherwise.

    Advanced Installer: How Do I Read a Windows Installer Verbose Log File?



    写入日志 : 从您自己的 MSI 日志文件中写入 自定义操作 没有那么难。这是来自 的有关该主题的入门读物罗伯特·迪考 :MSI Tip: Writing to the Log File from a Custom Action .
  • VBScript
  • C# / Managed code

  • 部分链接 :
  • Windows Installer Logging (大量核心信息,请阅读)
  • Windows Installer Best Practice (用于故障排除的详细日志记录)
  • MSI installation log says: Note: 1: 2205 2: 3: Error
  • In-use files not updated by MSI-installer (Visual Studio Installer project)
  • How Do I Read a Windows Installer Verbose Log File?
  • How to Reproduce MSI Install Error
  • How To Read A Windows Installer Verbose Log
  • 关于windows-installer - 在没有任何命令行参数的情况下为 MSI 安装程序启用安装日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54453922/

    相关文章:

    c# - 如何使用 c#/cmd 将新行添加到 msi 文件的属性表

    wix - MSI引用计数:两种产品安装相同的MSI

    registry - 如何正确地将文件关联添加到 Windows 注册表?

    wix - 在 wix 中更改我的组件 GUID?

    c# - 如何取消和回滚 VS2010 Windows Installer 中的自定义操作?

    windows - 使用wix复制目录结构

    installation - InstallShield中如何使用ISSetup.dll?

    windows - 在 Wix 中获取命令行参数

    installation - 使用 PSExec 以管理员身份远程运行 Msiexec

    vbscript - 如何根据 vbscript 自定义操作结果中止 InstallShield 安装程序?