WiX command-line option for no UI, '/quiet', kills the running process

大城市里の小女人 提交于 2019-12-24 01:51:33

问题


I have created a setupkit with no UI using Wix for my application (called "XYZ" here).

If I double click the MSI while XYZ.exe is runnning, it notifies me that a process is locking a file: I can choose to kill the locking process or I can abort the installation. This is fine: as a user I can decide what to do.

But when I run the same MSI from the commandline,

msiexec /i XYZ.msi /quiet /norestart

if XYZ.exe is found running it will be killed. This is absolutely inacceptable in my scenario: the MSI should abort the installation and exit.

The same setupkit works as expected if I set a "Mondo" interface (or any other interface).

What is the solution?


回答1:


The article you linked to says Restart Manager shuts down the running processes to mitigate reboot, and it should start the process after setup is complete. It also mentions which properties control the interaction with Restart Manager:

MSIRMSHUTDOWN when set to 2:

Processes or services that are currently using files affected by the update are shut down only if they have all been registered for a restart. If any process or service has not been registered for a restart, then no processes or services are shut down.

Ensure MSIDISABLERMRESTART has value of 0. In this case Restart Manager will restart all the processes and services it shut down.

See also MSIRESTARTMANAGERCONTROL


If you disable shutting down of running processes, the installation would not fail: it would succeed and Windows Installer will initiate system restart to complete the update. You can use /norestart option to suppress reboot. Yet it is recommended to reboot as soon as possible because the system is not in a consistent state.

Thus it's better to teach your process to communicate with Restart Manager so that reboot is mitigated.



来源:https://stackoverflow.com/questions/8354767/wix-command-line-option-for-no-ui-quiet-kills-the-running-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!