简体   繁体   中英

Why does my installer always prompt for reboot

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?

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.

我不知道为什么原始代码失败,但是我最终决定解决以下问题,该问题仅会在升级或卸载时进行重启。

<ScheduleReboot Sequence="7200">REMOVE~="ALL"</ScheduleReboot>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM