How to detect running program and ask to close it from VS Msi project?

I have a simple Visual Studio MSI project.

I want to HALT the installation if I detect a running program of a certain type (e.g. "aaa.exe") and wait until the user closes it before proceeding.

how do I do that?

Answers


Generally speaking, have you considered the Restart Manager?

Applications that use Windows Installer 4.0 for installation and servicing on Windows Vista automatically use the Restart Manager to reduce system restarts. The default behavior on Windows Vista is to shut down applications rather than shut down and restart the operating system whenever possible. In cases where a system restart is unavoidable, installers can use the Restart Manager API to schedule restarts in such a way that it minimizes the disruption of the user's work flow.

Restart Manager should automatically detect open files/handles-to-files that are are going to be updated by the .MSI and gracefully stop/restart them.


Need Your Help

How would you license your Mono code?

c# licensing mono

For C# in a winForms environment, I've licensed my classes by writing specifics to the regestry, encrypted.

Failure using ilasm, but no reason given

.net compilation ilasm

I am trying to use ILASM and the process seems to abort with the following message: