vbscript - 在wix中,使用vbscript,如何写入日志文件?

标签 vbscript wix

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

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

我收到错误:

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,

如何写入脚本内的日志?

最佳答案

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 Sample: I just remembered that I put a sample for this on github: https://github.com/glytzhkof/WiXVBScriptWriteToLog


提示:Here is a bunch of WiX / MSI links以调试为中心的各种主题。


链接:

关于vbscript - 在wix中,使用vbscript,如何写入日志文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60362396/

相关文章:

excel - WScript.Shell Exec 的实时控制台输出

c# - CustomAction 被调用两次

visual-studio-2010 - 您可以将生成的文件包含到 WiX 项目中而不将其添加为现有文件吗

windows - 如何创建 Windows 8 风格的安装程序

wix - Visual Studio 2010 beta 2 和 WiX?

java - Java Web 应用程序中的并发

asp-classic - 在 VBScript 中输出 GUID 会忽略其后的所有文本

VBscript - "The system cannot find the file specified"

mysql - 如何同时上传文件和插入语句到数据库

Wix:是否可以从自定义操作手动运行 RemoveFolderEx 元素?