Jump to content
mihaijulien

WinExists problem

Recommended Posts

mihaijulien

Hello,

I have the following piece of code:

RunWait(@ComSpec & " /c" & $cmd)
   Sleep(1000)
   If WinExists("Windows Installer") Then
      ControlClick("Windows Installer", "","[CLASS:Button; INSTANCE:1]")
   EndIf

It supposed to start an uninstall process, and then when the popup "Are you sure you want to uninstall?" it should click on the Yes button. The problem is that the script stops at this point. Nothing ever happens.

 

Any ideas what it could be?

Share this post


Link to post
Share on other sites
jguinch

RunWait pauses the script until the process finishes.

Use Run instead.

an example :

Local $iPid = Run(@ComSpec & " /c" & $cmd)
While ProcessExists($iPid)
   If WinExists("Windows Installer") Then ControlClick("Windows Installer", "","[CLASS:Button; INSTANCE:1]")
   Sleep(100)
WEnd

 

Edited by jguinch
  • Like 2

Share this post


Link to post
Share on other sites
mihaijulien

Thank you. That was what I was looking for. 

Share this post


Link to post
Share on other sites
Subz

Or you could try running msiexec.exe /x {GUID} /qb /norestart or msiexec.exe /x "Filename.msi" /qb /norestart, assuming this is a Windows Installer i.e. an Msi based installer

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×