Calling a Kill-Process Custom Action

InstallShield 2020

Project:This information applies to the following project types:

Basic MSI
InstallScript MSI
Transform

The kill-process type of custom action terminates one or more processes at run time. The following procedure describes how to include and configure this type of custom action in your project.

To add a kill-process custom action to your project:

1. In the View List under Behavior and Logic, click Custom Actions and Sequences.
2. Right-click the Custom Actions explorer and then click New Kill Process. InstallShield adds a kill-process custom action with a default name.
3. Enter a new name, or right-click it later and click Rename to assign it a new name. Use a name that helps you distinguish this custom action from other actions in your project.
4. In the right-pane, configure the action’s settings:
a. In the In-Script Execution setting, select the iteration of the sequence that should trigger the action. For details about each option, see In-Script Execution.
b. Use the settings in the Sequences area to schedule the custom action at the point where you want the process to be terminated. As an alternative, you can drag the custom action from the Custom Actions explorer to the appropriate node under the Sequences explorer.
c. In the Function Name setting, select the appropriate function:
KillProcess—If you selected one of the immediate options in the In-Script Execution setting and you want to kill a process that has a particular name, select this option.
KillProcessByID—If you selected one of the immediate options in the In-Script Execution setting and you want to kill a process that has a particular process identifier (PID), select this option.
KillProcessDeferred—If you selected one of the deferred, commit, or rollback options in the In-Script Execution setting and you want to kill a process that has a particular name, select this option.
KillProcessByIDDeferred—If you selected one of the deferred, commit, or rollback options in the In-Script Execution setting and you want to kill a process that has a particular PID, select this option.
d. In the Processes setting, enter executable file names or PIDs of the processes that you want to terminate.

If Function Name is set to:

Then, specify Processes using:

KillProcess or KillProcessDeferred

Executable file names

KillProcessByID or KillProcessByIDDeferred

PIDs

If you want to terminate more than one process, use a semicolon (;) to separate each file name or PID. For example, to terminate processes that have names such as myfile1.exe and myfile2.exe, enter the following:

myfile1.exe;myfile2.exe

Tip:The value of the Processes setting may by written to the ISTerminateProcesses property. If you have additional kill-process custom actions that do not specify a value in the Processes setting, such as those migrated from InstallShield 2015 or earlier, shared use of the ISTerminateProcesses property may result in undesired behavior.

e. Configure any of the action’s other settings as needed.

See Also