简体   繁体   English

为什么我的安装程序总是提示重启

[英]Why does my installer always prompt for reboot

I only want to reboot when uninstalling. 我只想在卸载时重启。 This is a fragment from my WiX file: 这是我的WiX文件的片段:

<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会生成以下日志:

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? 同一条件如何可能会得出False然后为True? Does ScheduleReboot ever ignore its condition? ScheduleReboot是否会忽略其条件?

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. 编辑:我还尝试使用条件REBOOT〜=“ Force”在我的customaction请求重新启动时有条件地执行命令。 This condition is never evaluating to true and my command is not being run. 此条件永远不会评估为true,并且不会运行我的命令。 The property is being set by a call to MsiSetProperty from a custom action. 该属性是通过自定义操作调用MsiSetProperty来设置的。 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. 某些操作可能正在设置REBOOT属性。 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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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