Windows Installer 延迟执行 - 我们如何记录在延迟模式下运行的自定义操作? [英] Windows Installer Deferred execution - how can we log the custom actions running in deferred mode?

查看:34
本文介绍了Windows Installer 延迟执行 - 我们如何记录在延迟模式下运行的自定义操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 MSI 中,我添加了 2 个要延迟执行的自定义操作.我无法在详细日志中看到这 2 个自定义操作以查看它们是否已执行.我可以看到在立即模式下执行的所有其他标准和自定义操作,但不能看到延迟.这是预期的行为吗?请帮忙

解决方案

WiX &VBScript:以下是一些答案,显示了如何在 MSI 中正确使用 VBScript 自定义操作 - 将其与下面显示的日志记录方法相结合,您应该可以在日志中找到您在其中写入的所有信息:

<小时>

更新:很可能在调用自定义操作之前您的设置已中止?或者您的自定义操作崩溃并没有返回错误?通常,您会在日志中看到以下内容:

调用远程自定义操作"使用 PID DECVAL (0xHEXVAL) 创建自定义操作服务器."您好,我是您的 32 位模拟自定义操作服务器."

等等......最后一个变体非常舒适.你好 doody 32 位服务器".

<小时><块引用>

综合日志:请使用额外调试信息启用详细日志code> 并使用无缓冲日志写入.后者是为了避免自定义操作崩溃时丢失缓冲区.日志文件是直接写入而不是批量写入,这会显着降低安装速度.我会为你的案例推荐这个日志变体:

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

提示:搜索"value 3" 在日志文件中查找错误,如 Rob Mensching 所述(Wix 和 Orca 作者).

<小时>

MSI 日志记录:有关 msiexec.exe 日志记录的更多信息:

WiX MSI 日志记录:当您使用 WiX 的 Visual Studio 时集成,您可以创建一个新的自定义操作项目,并且您可以使用它们在自定义操作中提供的内置日志记录:

[CustomAction]公共静态 ActionResult CustomAction1(会话会话){session.Log("开始CustomAction1");返回 ActionResult.Success;}

C++:以上是针对托管代码 C# 自定义操作的,还有一个用于 C++ 的模板(至少曾经有).我更喜欢后者,因为它的依赖性最小.

<小时><块引用>

自定义操作日志:您的自定义操作可以按如下方式写入日志文件:MSI 提示:从自定义操作写入日志文件.这是通过自定义操作代码完成的 - 您可能已经这样做了吗?

<小时>

链接:

In my MSI , I have added 2 custom actions to execute in deferred. I cant see these 2 custom actions in the verbose log to see whether these have executed or not. I can see for all other standard and custom actions executed in immediate mode, but not for deferred. Is this expected behavior ? Please help

解决方案

WiX & VBScript: Here are some answers showing how you can use VBScript custom actions in MSI properly - combine that with the logging approach shown below and you should find all information in your log that you write there:


UPDATE: Most likely your setup has aborted before the custom action was invoked? Or your custom action crashed and returned no error? Normally you will see entries in the log along the lines of:

"Invoking remote custom action"
"Created Custom Action Server with PID DECVAL (0xHEXVAL)."
"Hello, I'm your 32bit Impersonated custom action server."

Etc... Very cosy that last variant. "Howdy doody 32bit server".


Comprehensive Logging: Please enable verbose logging with extra debugging information and use buffer-less log writing. The latter is to avoid lost buffer when custom actions crash. The log file is written directly instead of in batches and this slows down installation dramatically. I would recommended this logging variant for your case:

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

Tip: Search for "value 3" in the log file to find errors as explained by Rob Mensching (Wix & Orca author).


MSI Logging: Some more information about msiexec.exe logging in general:

WiX MSI Logging: When you use WiX's Visual Studio integration, you can create a new Custom Action project and you can use the built in logging they provide from within the custom action:

[CustomAction]
public static ActionResult CustomAction1(Session session)
{
   session.Log("Begin CustomAction1");

   return ActionResult.Success;
}

C++: The above is for a managed code C# custom action, there is a template (at least there used to be) for C++ as well. I much prefer the latter for minimal dependencies.


Custom Action Logging: Your custom action can write to the log file as follows: MSI Tip: Writing to the Log File from a Custom Action. This is done via custom action code - you might do this already?


Links:

这篇关于Windows Installer 延迟执行 - 我们如何记录在延迟模式下运行的自定义操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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