Diego
Diego

Reputation: 2360

installshield stop old process before install new version

I have a setup made with installshield 2012, framework 3.5 and I am generating a new setup. My problem is that my UpgradeCode had to be changed. So I need to Update mi .exe with a different UpgradeCode. My problem is tan when I have the old .exe versión running, the installation do not execute well and the .exe failed when execute. What I need to do is to CONFIRM that Old versión is not running before Install the new version. I have tried to include in my Installer class

public override void Install(IDictionary stateSaver)
{
      Process[] processes = Process.GetProcessesByName(processID); 
      foreach (Process process in processes)
      {
            process.Kill();
            process.WaitForExit();
            process.Close();
      }
}

But it does not work. Any Ideas? Thanks

Upvotes: 0

Views: 1310

Answers (1)

Bogdan Mitrache
Bogdan Mitrache

Reputation: 10993

Instead of killing without any notifications your application (which myight lead to your users losing unsaved data, etc...) you could ask the user to close it and stop the installation of the new version until the old application is closed.

The above link explains how to do it with another tool, but with the right set of custom actions it can be achieved in any setup authoring tool.

Upvotes: 2

Related Questions