Visual Studio Kill Process in Setup Project

288 views Asked by At

There is one issue I keep facing in case of an upgrade Setup Project using Visual Studio 2012, it keeps asking for a restart to complete the configuration, how I can avoid that, I found one solution but still not working is to kill the process in BeforeInstallEventHandler.

please assist on this.

1

There are 1 answers

0
PhilDW On

Visual Studio setup projects have no way provided to do this. Despite custom actions with names like "BeforeInstall..." they all run after the files are installed (nearly at the end) and therefore are much too late to terminate a process.

You're usually asked to restart because there are files in use that need replacing. It's not clear why you are not seeing the standard files-in-use dialog asking you to shut down apps to avoid a restart. This implies that maybe you have a service or a tray app, or at least a process without a visible window. The kind of thing you can do in these situations is to have the uninstall of the older product shut down the running app or service when it's being upgraded, but if you've shipped that old product it's too late now.