Reputation: 6251
I only want to reboot when uninstalling. This is a fragment from my WiX file:
<InstallExecuteSequence>
...
<Custom Action="CleanRegistry" Sequence="7100">REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE</Custom>
<ScheduleReboot Sequence="7200">REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE</ScheduleReboot>
</InstallExecuteSequence>
Running the generated MSI produces the following log:
MSI (s) (48:7C) [10:19:29:951]: Skipping action: CleanRegistry (condition is false)
MSI (s) (48:7C) [10:19:29:951]: Doing action: ScheduleReboot
How is it possible that the same condition evaluates to False then True? Does ScheduleReboot ever ignore its condition?
Edit: I am also trying to use the condition REBOOT~="Force" to conditionally execute a command when a reboot has been requested by my customaction. This condition is never evaluating to true and my command is not being run. The property is being set by a call to MsiSetProperty from a custom action. Either this custom action is not working or I have made a mistake in my condition! Any suggestions?
Upvotes: 1
Views: 910
Reputation: 6251
I don't know why the original code was failing but I have ended up settling on the following which only does a reboot on upgrade or uninstall.
<ScheduleReboot Sequence="7200">REMOVE~="ALL"</ScheduleReboot>
Upvotes: 0
Reputation: 4436
Some action might be setting the REBOOT property. You should be able to see that in the log. The most common reason is probably files in use.
Upvotes: 1