Running Bat file during Uninstall
Hi all
is there a way to stop an installed program (.exe) before starting uninstall.
What i have done is I wrote a batch file that accomplish this task. But i don't know how can I run my Bat file in my Setup during Uninstall!!
Can it be done with bach file and how to use them in my setup??
is there any other way
Thanks in adcvance
Best Regards
is there a way to stop an installed program (.exe) before starting uninstall.
What i have done is I wrote a batch file that accomplish this task. But i don't know how can I run my Bat file in my Setup during Uninstall!!
Can it be done with bach file and how to use them in my setup??
is there any other way
Thanks in adcvance
Best Regards
0 Comments
[ + ] Show comments
Answers (10)
Please log in to answer
Posted by:
Meic
15 years ago
Posted by:
anonymous_9363
15 years ago
Whichever route - via deployment tool or in the MSI - I'd use a script instead of a batch file. You get much more control, in that you can easily test for return values and such without resorting to the horrors of piping the output to a temporary file and then using FIND (or whatever) to gauge success or failure. You can thus ensure, in a loop, whether or not the process actually got stopped before progressing.
Posted by:
daher
15 years ago
Posted by:
anonymous_9363
15 years ago
There are innumerable examples on the web. Try http://www.computerperformance.co.uk as a starting point or, as ever, use Google: VBSCript +WMI +process +terminate
Posted by:
AngelD
15 years ago
Regarding using vbscript wmi to kill a process; have a look at http://forums.altiris.com/messageview.aspx?catid=44&threadid=43062&arctab=arc
Posted by:
daher
15 years ago
Posted by:
AngelD
15 years ago
Posted by:
daher
15 years ago
got it.
I inserted the script with properties "Processing ASYNC,No Wait".
It worked but seems that the installer is faster then the script so it kept telling me that my installed exe is still running. When i press retry the script is finished and the uninstall continues normally.
so i changed properties "Processing ASYNC,Wait". or Sync... Then i got error 1720 and i could never uninstall since it tells "a script is required for this install to complete could not be finished",
Even if I set back the property to ASYNC,No Wait i still get this error.
So how can i Unistall without getting this synchronisation problem.!!!
and how can i make my setup waits for the the script to finish without getting this error?!
Here is the script:
For Each Process In GetObject("winmgmts:{impersonationLevel=impersonate}!//localhost").ExecQuery("select * from Win32_Process WHERE Name ='calc.exe'")
Process.Terminate
Next
wscript.quit(0)
Thanks again!!!
I inserted the script with properties "Processing ASYNC,No Wait".
It worked but seems that the installer is faster then the script so it kept telling me that my installed exe is still running. When i press retry the script is finished and the uninstall continues normally.
so i changed properties "Processing ASYNC,Wait". or Sync... Then i got error 1720 and i could never uninstall since it tells "a script is required for this install to complete could not be finished",
Even if I set back the property to ASYNC,No Wait i still get this error.
So how can i Unistall without getting this synchronisation problem.!!!
and how can i make my setup waits for the the script to finish without getting this error?!
Here is the script:
For Each Process In GetObject("winmgmts:{impersonationLevel=impersonate}!//localhost").ExecQuery("select * from Win32_Process WHERE Name ='calc.exe'")
Process.Terminate
Next
wscript.quit(0)
Thanks again!!!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.