Schedule reboot from WiX deferred custom action

不想你离开。 提交于 2020-01-04 06:24:50

问题


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?


回答1:


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

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.



来源:https://stackoverflow.com/questions/27398174/schedule-reboot-from-wix-deferred-custom-action

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!