Jump to content

WinwaitClose Not Working for me


Recommended Posts

Hi all, I thought I had this finished, but the WinWaitClose command I had which was working originally is now not working, can anybody help me out?

Func MSDEButton()
  Run("sql70ins.bat")
    WinWaitClose("%SystemRoot%\system32\cmd.exe", "%SystemRoot%\system32\cmd.exe")
    Sleep(3000)
  Run("sql70sp4.exe")
    WinWaitActive("Installation Folder")
    ControlClick("Installation Folder", "Finish", 12325)
    WinWaitActive("PackageForTheWeb")
    ControlClick("PackageForTheWeb", "&Yes", 6)
    WinWaitActive("PackageForTheWeb")
    ControlClick("PackageForTheWeb", "OK", 2)
    WinWaitClose("PackageForTheWeb")
  Run("C:\70SP4\setup.bat", "C:\70SP4\")
EndFunc
Link to comment
Share on other sites

or use the macro:

Of course the macro is the easier way. I just wanted to point out that environment variables have to be resolved using envget() :)

So finally the suggestion for reading up help files and FAQ (sticky postings topmost in this forum) has to be mentioned. :hint:

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

It still doesn't seem to be working correctly, the script still moves into the next install without waiting for the other window to close.

Would it have anything to do with the installer being in silent install mode? I'm not sure, but I'm just venturing a guess.

Edited by jsisson01
Link to comment
Share on other sites

It still doesn't seem to be working correctly, the script still moves into the next install without waiting for the other window to close.

Would it have anything to do with the installer being in silent install mode? I'm not sure, but I'm just venturing a guess.

How about using the process ID instead of the window title:
Func MSDEButton()
  Local $PID = Run("sql70ins.bat")
    Sleep(1000)
    ProcessWaitClose($PID)
    Sleep(3000)
    
    ; ...
    
EndFunc

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...