How to kill a task as part of MSI uninstall using a transform file?
I'm applying a transform on a vendor msi for the installation using wise package stuido 8. This application creates a task in the start up. Before the application can be uninstalled, that task needs to be killed. The command line to kill that task is "taskkill /IM Alertwatch.exe My question is, where in my transform can I include that command line for it to launch during uninstall. Thanks and I appreciate any help.
Stop the service first through service control table and the specify custom action to kill the process.
1. Stage it before "Remove files" Sequence in installexecute sequence table.
2. You can also stage it before installfinalize.
Use the below condition to run the custom action during uninstall only.
If REMOVE~="All" then
Taskkill.exe /IM Alertwatch.exe
1. Killing the process before the files uninstallation will free the file if it in use.
2. before installfinalize: if the file is in use, windows installer will not uninstall it, instead it will add it to pending files actions and the file gets removed when the user reboots his machine next time. This will leave the directory on the machine where file was located.
Using the Taskkill.exe /IM Alertwatch.exe command directly to kill process in custom action during uninstallation/installation prompts a command prompt when it is executing this command line.. Some process takes more time to terminate itself, So, it is always better to use VBScript to do these type of stuffs. So It wont distrub the end users by prompting a command prompt at the time of uninstallation.
I will make your work easy. :)
Use the script here:
Create a Customa Action and place it just after InstallFinalize and Run it in Deffered execution in System Context. Put condition as REMOVE~="ALL"