在 wix 中,使用 vbscript,如何写入日志文件? [英] In wix, using vbscript, how do I write to the log file?

查看:55
本文介绍了在 wix 中,使用 vbscript,如何写入日志文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在自定义操作中尝试以下操作:

I am trying the following inside a customaction:

Session.Log("GetOfficeBitness =" & Session.Property("OfficeBitness"))

我收到错误:

错误 1720.此 Windows 安装程序包有问题.一种无法运行此安装完成所需的脚本.接触您的支持人员或软件包供应商.自定义操作GetOfficeBitness 脚本错误 -2146827850,Microsoft VBScript 运行时错误:对象不支持此属性或方法:'Session.Log'第 39 行,第 9 列,MSI (c) (FC:94) [05:51:13:621]:产品:WindwardReport Designer 32-bit -- Error 1720. 这个有问题Windows 安装程序包.此安装所需的脚本完全无法运行.联系您的支持人员或包裹小贩.自定义操作 GetOfficeBitness 脚本错误 -2146827850,Microsoft VBScript 运行时错误:对象不支持此属性或方法:'Session.Log' 第 39 行,第 9 列,

Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action GetOfficeBitness script error -2146827850, Microsoft VBScript runtime error: Object doesn't support this property or method: 'Session.Log' Line 39, Column 9, MSI (c) (FC:94) [05:51:13:621]: Product: Windward Report Designer 32-bit -- Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action GetOfficeBitness script error -2146827850, Microsoft VBScript runtime error: Object doesn't support this property or method: 'Session.Log' Line 39, Column 9,

如何写入脚本中的日志?

How can I write to the log inside my script?

推荐答案

日志记录:请尝试阅读 Robert Dickau 的 MSI 提示:从自定义操作写入日志文件.在本质上像这样:

Logging: Please try to read Robert Dickau's MSI Tip: Writing to the Log File from a Custom Action. In essence something like this:

option explicit
dim inst, rec
set inst = CreateObject("WindowsInstaller.Installer")
set rec=inst.CreateRecord (2)
rec.StringData(1) = "Logging call from " & property("CustomActionData")
Session.Message &H04000000, rec


WiX 示例:我只记得我在 github 上为此放了一个示例:https://github.com/glytzhkof/WiXVBScriptWriteToLog


提示:这里有一堆 WiX/MSI 链接,内容涉及以调试为中心的各种主题.


Tip: Here is a bunch of WiX / MSI links on all kinds of topics centering around debugging.

链接:

  • Enable installation logs for MSI installer without any command line arguments (about MSI logging in general)
  • Windows Installer Deferred execution - how can we log the custom actions running in deferred mode?

这篇关于在 wix 中,使用 vbscript,如何写入日志文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆