Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Schedule reboot from WiX deferred custom action

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?

like image 694
Cocowalla Avatar asked Sep 03 '25 04:09

Cocowalla


1 Answers

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.

like image 66
Christopher Painter Avatar answered Sep 04 '25 23:09

Christopher Painter