In your Installer project (I'm assuming you have generated an MSI installer using an Installer project in Visual Studio), you should include a class that inherits from the Installer base class:
[RunInstaller(true)]
public class MyInstaller: Installer
{
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
}
public override void Uninstall(IDictionary savedState)
{
base.Uninstall(savedState);
//TODO: Code to kill the live instance(s)
}
// Other override methods here if necessary
}
This class' Uninstall method will get executed when the user uninstalls your application.
In this method, you can select the list of running processes and kill all live instances of your app.