/build/static/layout/Breadcrumb_cap_w.png

Kill a Process

Hi,
I try to kill a process during uninstall.
I use Wise installer to compile my package and I used this command:
taskkill /F /IM "application ID", but I don't know how to do that during remove.
Thank you for your help.

0 Comments   [ + ] Show comments

Answers (14)

Posted by: TomB 19 years ago
Orange Belt
1
Try the following:

'Decalre Variables
Dim objWMIService,colProcessList,objProcess
Dim strComputer, strProcess

'Define Variables
strComputer = "."
strProcess = "process" '<= Insert process name here

'Get Process List
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = '" & strProcess & "'")

'Terminate Process
For Each objProcess in colProcessList
objProcess.Terminate()
Next
Posted by: TheQuaker 19 years ago
Senior Yellow Belt
0
Hi Tomb,
Thank you for your help but your response is not complete.
I know use a script to kill a process.
But I don't know how to do this since a remove.
Q.
Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
If you only want the custom action to run on remove, then you need to condition the action using the following syntax:

REMOVE~="ALL"
Posted by: TheQuaker 18 years ago
Senior Yellow Belt
0
I brentHunter,
Thank you for your help.
I 'm going to try this.
Q.
Posted by: shogun_ro 18 years ago
Orange Belt
0
You can also try pskill.exe from system internals. You can make a custom action that runs pskill.exe under system context. Its guaranteed to work on every Windows operating system.
Posted by: coolamerboy 16 years ago
Senior Yellow Belt
0
Greetings all
I have problem to kill a process when i try to uninstall the application vaio event service!
When i uninstall the application manually it say that "vaio event sevice is in use, to set up it you need to stop this program first. Stop vaio evenr service now?
I want to kill this process but i don´t know how!
My uninstall file look like this:

setup.exe /s /f1"z:\APPS\Vaio Event Service\2.7\uninstall.iss"

When i run that nothing happens!

Grateful for any help
Posted by: anonymous_9363 16 years ago
Red Belt
0
Killing a process should always be the last resort. Instead, find out the name of the service and stop that, using 'NET STOP [name_of_service]' or, more elegantly, using a WMI-based script. Only if the service fails to stop within a reasonable time should you then think about killing the process.
Posted by: coolamerboy 16 years ago
Senior Yellow Belt
0
I tried with it and it didn´t work!
It seems that my uninstall.cmd is not working, i allready looked in google but i couldn´t figuer it out.
I need help with the syntax, how can i run my uninstall file with or without pskill.

Please help!
Posted by: aogilmor 16 years ago
9th Degree Black Belt
0
It may also be possible to do using the ServiceControl table within the MSI. Try that first, then a WMI script, then "net use", then kill the process. As Ian points out this should be a last resort.
Posted by: anonymous_9363 16 years ago
Red Belt
0
ORIGINAL: aogilmor
It may also be possible to do using the ServiceControl table within the MSI.
The presence of a response file would suggest that this is a InstallShield script-driven install, not an MSI-driven one. I have no knowledge of IS script so I can't help in that regard.

ORIGINAL: coolamerboy
I tried with it and it didn´t work!
What didn't work? What did you try? What investigations have you done to determine why it didn't work? The old psychic powers have deserted me again... :)
Posted by: coolamerboy 16 years ago
Senior Yellow Belt
0
Hi again,

The thing is that i don´t have msi-file here, its an installshield.
I stated with stop the service and i managed to do that but it inly stop the service, the uninstall fails!

setup.exe /S /f1"z:\APPS\vaio event service\2.7\uninstall.iss"
net stop "vaio event service"

But as i said it only stop the service but doesn´t uninstall the application.
I also tried with:
taskkill \IM VESMgr.exe and it kill the process but doesn´t uninstall!

Any ideas?
Thank you
Posted by: coolamerboy 16 years ago
Senior Yellow Belt
0
This is my uninstallstring if it help:.

RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\PROFES~1\RunTime\11\50\Intel32\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{F0D85ADD-DD61-4B43-87A0-6DA52A211A8B}\setup.exe" -l0x9 -removeonly

I tried to use it but i failed.
Posted by: anonymous_9363 16 years ago
Red Belt
0
You need to combine BOTH commands, firstly to stop the service and then to uninstall the app.

I suspect that the service may not have fully stopped by the time the uninstall takes place, which is why I suggested using a script. That way, you can test whether the service has stopped or not before proceeding with the uninstall.
Posted by: aogilmor 16 years ago
9th Degree Black Belt
0
ORIGINAL: VBScab

ORIGINAL: aogilmor
It may also be possible to do using the ServiceControl table within the MSI.
The presence of a response file would suggest that this is a InstallShield script-driven install, not an MSI-driven one. I have no knowledge of IS script so I can't help in that regard.

ORIGINAL: coolamerboy
I tried with it and it didn´t work!
What didn't work? What did you try? What investigations have you done to determine why it didn't work? The old psychic powers have deserted me again... :)



I was thinking that he is using an MSI to install a product (although the OP's description "Wise installer" is a bit ambiguous - i suppose it could be wise script) --and he needed to make the uninstallstring work to uninstall the old product. Maybe I'm not understanging but it seems to me, from my reading, that you could use ServiceControl to stop a service from another app during install. I have not tried it personally. Getting the uninstallstring to work is another issue - my preference as always is not to rely on the very old installshield and just use my own CA's, RemoveFile and RemoveRegistry entries to get rid of it.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ