[wix-users] StartServices when a reboot is pending

Rob Hamflett robworksn at outlook.com
Tue Mar 7 02:13:07 PST 2017


Hi,


What is the correct way to handle services when a reboot is pending? I don't see good way to do this. StartServices starts the service regardless, so you're potentially running an incorrect installation. I recently discovered that you can use MsiGetMode() to see if a reboot is pending, and I'm now using this as a check for whether or not to start the UI afterwards. Unfortunately I can't use this to conditionally start the service as it is severely limited when called from a deferred or commit action. As far as I can tell, this leaves you with two options:

1) Just start the service as per normal, and let any possible runtime errors just happen until the reboot occurs.

2) Don't start the service, check if a reboot is pending after all deferred actions have run, and submit the user to another elevation prompt to start the service.


Is there a better way to handle this?


Thanks,

Rob



More information about the wix-users mailing list