In Installation Designer -> Behavior and Logic -> CustomActions and Sequences, Right Click and select "New Kill Process"
Provide the name of custom action and then choose FunctionName, In-Script options
-> Choose when you want to run the action and provide condition to run when satisfied.
-> If In-Script Execution is selected as one of Execute Immediate process. Goto Properties and create a New Property with Name ISTerminateProcesses and provide the list of process to be terminated.
-> If In-Script exeuction is selected as one of the deferred execution then create a property whose name is same as the name of the custom action ( in this example: KillWord ) give and provide the list of process to be terminated.