Jump to content

How To Handle Surpise Install Windows?


Recommended Posts

Hello,

Just found Autoit a month ago. Very cool.

I'm trying to install SAP using it.

I have it doing everything including running a BAT file at the end (thank you forum).

But when I run this on some machines, at the end of the install, they get a windows titled SAPinstall (text says something about you must restart).

Because of this window, my script stops waiting for the next window.

If I add WinWaitActive it works but then I run into a circle. Because some computers do not get the restart window.

So in short, how to I make AutoIt answer a window but only if that window comes up?

Thanks,

Tony

Link to comment
Share on other sites

Wow, that was a fast response.

That looks exactly what I'm looking for. I have one queston at that though. Looking at the help, They had two parts. One to call a function and one to create it. Is this correct (I'm coming from that days of Basic and Fortan).

So do I need both parts or just the first part and not creat a function? Also their example didn't have a timer when to check. Is this needed? Can you just do AdlibEnable for 1 window or can I have several Adlib?

AdlibEnable("SurpiseWin")

;...

Exit

Func SurpiseWin()

If WinActive("Error") Then

ControlClick ("Error", "There was an error", Button1)

EndIf

EndFunc

Link to comment
Share on other sites

yes... both parts are needed - I would use WinExists:

Func SurpiseWin()
    If WinExists("Error") Then ControlClick("Error", "There was an error", Button1)
EndFunc;==>SurpiseWin

Timer - or how often AdlibEnable is to check (run) is here:

AdlibEnable ( "function" [, time] )

time is [optional] how often in milliseconds to call the function. Default is 250 ms.

Check for as many windows as you like within one adlib function or create as many adlib functions as you would like and enable/disable them thru-out your code.

Edit: Welcome to the forums...

Edit2: Wish I could tyype/spelllle

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

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...