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
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0

To do this, I wouldn't add the bat file to the MSI but would add it to the deployment tool, and specify the batch file to be run before 'uninstall'. This is an option on our dep tool - not sure if it is on yours?
Answered 09/10/2008 by: Meic
Second Degree Blue Belt

Please log in to comment
0
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.
Answered 09/10/2008 by: VBScab
Red Belt

Please log in to comment
0
Thanks for your replies

I am not familiar with scripting !!!!
can anyone provide me with such script and how to use it where to add it?!


Thanks again
Answered 09/10/2008 by: daher
Orange Belt

Please log in to comment
0
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
Answered 09/10/2008 by: VBScab
Red Belt

Please log in to comment
0
Regarding using vbscript wmi to kill a process; have a look at http://forums.altiris.com/messageview.aspx?catid=44&threadid=43062&arctab=arc
Answered 09/10/2008 by: AngelD
Red Belt

Please log in to comment
0
So far so good!

the next question where and how should i insert this script in my setup?!

note that i want to execute the script during uninstall before the setup attempts to delete the deployed exe files


Thanks for the valuable help
Answered 09/10/2008 by: daher
Orange Belt

Please log in to comment
0
Use a condition of REMOVE~="ALL" and sequence the CA just before the RemoveFiles action in deferred execution
Answered 09/10/2008 by: AngelD
Red Belt

Please log in to comment
0
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!!!
Answered 09/10/2008 by: daher
Orange Belt

Please log in to comment
0
Remove wscript.quit(0) and you should be fine.
Answered 09/10/2008 by: AngelD
Red Belt

Please log in to comment
0
...and set the CA to wait.
Answered 09/11/2008 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity