Jump to content

WinExists problem


Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...