安排从WiX延迟的自定义操作重启 [英] Schedule reboot from WiX deferred custom action

查看:89
本文介绍了安排从WiX延迟的自定义操作重启的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WiX延迟自定义操作,该操作有条件地修改了某些注册表项。为了使更改生效,需要重新启动。我希望用户得到一个标准对话框,提示他们在安装完成后重新启动。

I've got a WiX deferred custom action that conditionally modifies some registry keys. For the changes to take effect, a reboot is required. I'd like the user to get the standard dialog box that prompts them to reboot after the installation completes.

如何安排从延迟的自定义操作重新启动?

How can I schedule a reboot from a deferred custom action?

推荐答案

为什么要执行自定义操作,以使MSI / WiX知道如何本地执行操作?

Why do you have a custom action doing something that MSI/WiX knows how to do natively?

一种更清洁的方法是使注册表值与具有所需条件的组件关联。然后,您可以通过相同的条件触发一个简单的自定义操作,并使用MSIRUNMODE_REBOOTATEND参数调用MsiSetMode。如果您使用的是C#/ DTF,则为session.SetMode(InstallRunMode.RebootAtEnd)。

A cleaner approach would be to have registry values associated with a component that has the needed condition. Then you can have a simple custom action trigged by that same condition call MsiSetMode with the MSIRUNMODE_REBOOTATEND argument. If you are using C#/DTF that's session.SetMode(InstallRunMode.RebootAtEnd).

这样,如果安装中止,取消或失败,则可以回滚注册表更改

This way if the install is aborted, canceled, failed it can roll back the registry changes.

这篇关于安排从WiX延迟的自定义操作重启的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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