Sign in to follow this  
Followers 0
pjw73nh

Script doesn't wait until end to send key.

5 posts in this topic

Greetings,

This is a portion of a script that installs a client. Unfortunately, the windows all have the same title.

Run(@WorkingDir & "\vpnclient_setup.exe")
    WinWaitActive("Cisco Systems VPN Client 5.0.00.0340 Setup")
    Send("!n")
    WinWaitActive("Cisco Systems VPN Client 5.0.00.0340 Setup")
    Send("!a")
    Send("!n")
    WinWaitActive("Cisco Systems VPN Client 5.0.00.0340 Setup")
    Send("!n")
    WinWaitActive("Cisco Systems VPN Client 5.0.00.0340 Setup")
    Send("!n")
    WinWaitActive("Cisco Systems VPN Client 5.0.00.0340 Setup")
    Send("!f")

The script runs fine until it gets to the last "WInWaitActive".

The way it is supposed to run is:

The first four "WinWaitActive"s Are all answers to windows that have simple questions. IE "Next, All, Next, Next, Next. On this fourth one, the program runs the actual install which takes anywhere from 30 second to 5 minutes depending on network load. My problem is that the way it is written, it sends the last "F"inish immediately after processing the 4th "WinWait Active". It doesn't wait for the actual install program to complete and display the last window where the "F"inish is an option. I suppose I could put a long delay in there, but that would unnecessarily delay a fast PC from installing. I am sure there is another command I could use that would solve my problem. I just can't find it.

Thanks for any help.

P.

Share this post


Link to post
Share on other sites



After first WinWaitActive() your window is still active so other WinWaitActive() are useless.

You must use some other Autoit commands to see if some action is done.

See ControlCommand, ControlGetText for example.

Share this post


Link to post
Share on other sites

Does the windows have any text... WinWaitActive("title", "text")


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

How about trying to use it in nicer way, to customize it to your company needs, settings and with everything. Here's the link. This way you can just use RunWait(.exe) and it should do all nessecary things automagically without need to do automation of windows.

Cheers,

Ps. 90% of standard applications have some silent switches, configuration files so if i were you i would go that way with any instalations you have to do. Use the Windows, mouse automatization only in cases where there's no such option (as in in some very non-standard applications).

MadBoy

Edited by MadBoy

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

How about trying to use it in nicer way, to customize it to your company needs, settings and with everything. Here's the link. This way you can just use RunWait(.exe) and it should do all nessecary things automagically without need to do automation of windows.

Cheers,

Ps. 90% of standard applications have some silent switches, configuration files so if i were you i would go that way with any instalations you have to do. Use the Windows, mouse automatization only in cases where there's no such option (as in in some very non-standard applications).

MadBoy

Or commandline parametres for silent mode:

Silent Installation Using MSI

To install the VPN Client without dialogs and messages (user interface) displaying on the screen, you can use either of the two following commands on the command line.

msiexec.exe /q [n|b|r|f] /i vpnclient_en.msi

or

vpnclient_en.exe /q [n|b|r|f]

Then Only RunWait() will be neccessary

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
Sign in to follow this  
Followers 0