mihaijulien

WinExists problem

4 posts in this topic

#1 ·  Posted

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



#2 ·  Posted (edited)

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
2 people like this

Share this post


Link to post
Share on other sites

#3 ·  Posted

Thank you. That was what I was looking for. 

Share this post


Link to post
Share on other sites

#4 ·  Posted

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

1 person likes this

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