1

I have added custom action "Install" in the installer to run ProcessMonitor.exe at the background. ProcessMonitor is an application which examines my application and deletes unwanted/temporary files. So when an application installs on destination machine it runs processMonitor.exe in the background. Now when I select a repair/remove option it gives the error saying "The following applications are using files which the installer must update. You can either close the application & click Try again or click continue."

If I manually kill ProcessMonitor repair/remove option works successfully.

I want a way to first kill processMonitor.exe before installer copies/remove files from destination folder in case of repair/remove.

Ru Chern Chong
  • 3,692
  • 13
  • 33
  • 43

1 Answers1

0

Deferred Mode CA: To succeed killing elevated processes, you need to run elevated. That means a deferred mode custom action in MSI. What tool are you using?

Legalese: Have you checked whether ProcessMonitor.exe is redistributable? I am not sure it is. I would definitely clarify that to avoid any legal problems. It is a free tool, but that does not necessarily mean you can deploy it with your own package (redistribute it), though it might be allowed since this is an established, mature and reputable product.

Procmon.exe: Is this tool really necessary for your product? It is very strange to install this to be honest, seeing as it is a specialist tool and generally undesirable in the hands of regular users? If you need it for testing you can compile it into your debug setups and remove it from the release setup. Are you using WiX? Try compiler variables / preprocessor constructs (see concrete markup code towards bottom). Some more WiX variable details.

Close Applications: There is a built-in feature in procmon.exe to shut itself down which is shown below, however, there are many other approaches that could work. Here is a quick list. And here is another WMI approach. Most tools should never be forcefully terminated, but this tool may be entirely read-only. I am not sure.

Terminate: You should be able to terminate procmon.exe instances by calling procmon.exe as follows: procmon.exe /Terminate. However, it seems it terminates only one instance at a time.

The command line parameter list available when running Procmon.exe /?:

Procmon.exe

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164