When you have services or processes that are always running in the background, when you decide to uninstall the application you may be presented with this dialog box:
This dialog is created by the InstallShield engine after the “CostFinalize” Standard Action is completed. It recognizes that a process is running that is slated for removal (could be a service or a actively running program) –so it attempts to get the issue resolved before it encounters a “File Locked” scenario.
I would rather kill the running process than allow this dialog box to hang up the installation – plus it seems likely that there will be a customer call to the support center, and that could be bothersome.
Option #1: Using the new Kill-Process Custom Action
If you are using InstallShield 2012 Spring (or later), they introduced a new Custom Action – the “Kill Process” – as shown here:
Here is the help topic on the Kill Process. To summarize:
- Create a new Custom Action “ISI_KillProcess” – or in my sample “ISI_KillMAP”
- Sequence it correctly – I wanted it quite early in the sequencing, plus I wanted to run it when the customer ran it silently (without UI Sequence)
- Create a new MSI Property “ISTerminateProcesses” that contains a list of the processes to kill (if multiple ones, such a previous release names), separate by semicolon (;)
Option #1: Building your own Kill-Process Custom Action
If you are using any previous versions of InstallShield 2011 (or earlier), you have to create your own Custom Action to “Kill a Process”. I had typically used an InstallScript Custom Action (scripts downloaded from InstallSite.org ) to check for running processes – but the script ran very slow – and if you are checking for quite a few older versions (such as when you perform a “Major Upgrade” it could take over 5 minutes.
I built this Kill Process Custom Action using the standard “New EXE – Path referencing a directory” – as shown here:
- Create a new Custom Action “ISI_KillProcess”
- Sequence it correctly – I wanted it quite early in the sequencing – but the InstallScript engine needs to resolve the working directory “WindowsFolder” – so you have to sequence it after “ResolveSource” in the UI Sequence – and “CostFinalize” in the Execute sequence
- Select “WindowsFolder”
- Enter the following “taskkill /F /IM XXXXXX” – where ‘/F’ means to force the kill, ‘/IM’ is the option to provide the process name – and use the full process name (including the .EXE).
Hope this helps!