Find and Close or Terminate plug-in and macro
Running application that installer intends to replace or remove is a common problem, and this is why we can find so many samples on the forum how to find window and close it or how to kill process by name :). I don't like process termination as a first step (not saved data loss, exe file may stay marked 'in use' and cause a reboot), so I wrote combined script, it finds window and first tries to close it but, if process is still alive after timeout, terminates application. Not a big deal, but this looks more safe for me, this is link to Find and Close or Terminate macro.
But there are 2 problems with this macro: in the 'safe' (not looping) version it closes one instance of application only; System plug-in required. System plug-in is not so big (10 kB), but I had to include it both to installer and uninstaller (double size). And the only reason for this in some packages is safe program termination only (using my macro). This is why I uploaded very compact (2 kB in zip) Close or Terminate plug-in, it scans all top level windows using EnumWindows and closes or terminates all instances of application. It also can find window by part of it's title (caption). Compare to System plug-in I could use simple script and reduce package size (-4 kB for installer only, the same for uninstaller). BTW Afrow UK wrote about this not long ago ;).