Sign in to follow this  
Followers 0
icare

Help, script paused

4 posts in this topic

Hi,

I am a newbye in scripting.

I have to perform multiple (unattended) installations on the computers of the pcroom of my school and tried to use Autoit.

But the scripts pause after the first windows.

May be a very easy question but can you help me please?

Here is an example of a script:

Run("foxitreadersetup.exe")

WinWaitActive("Apri file - Avviso di protezione", "Eseguire il file?")

ControlClick("Apri file - Avviso di protezione", "Eseguire il file?", 4424)

WinWait("Foxit Reader Install Wizard", "Setup will install Foxit Reader on your computer")

If Not WinActive("Foxit Reader Install Wizard", "Setup will install Foxit Reader on your computer") Then

WinActivate("Foxit Reader Install Wizard", "Setup will install Foxit Reader on your computer")

EndIf

WinWaitActive("Foxit Reader Install Wizard", "Setup will install Foxit Reader on your computer")

Send("!n")

STOPS HERE!!!

WinWait("Foxit Reader Install Wizard", "Please read the license terms below")

If Not WinActive("Foxit Reader Install Wizard", "Please read the license terms below") Then

WinActivate("Foxit Reader Install Wizard", "Please read the license terms below")

EndIf

WinWaitActive("Foxit Reader Install Wizard", "Please read the license terms below")

Send("!a")

WinWait("Foxit Reader Install Wizard", "Please select an installation type")

If Not WinActive("Foxit Reader Install Wizard", "Please select an installation type") Then

WinActivate("Foxit Reader Install Wizard", "Please select an installation type")

EndIf

WinWaitActive("Foxit Reader Install Wizard", "Please select an installation type")

ControlClick("Foxit Reader Install Wizard", "Please select an installation type", 1014)

WinWait("Foxit Reader Install Wizard", "Click Install to continue with the installation")

If Not WinActive("Foxit Reader Install Wizard", "Click Install to continue with the installation") Then

WinActivate("Foxit Reader Install Wizard", "Click Install to continue with the installation")

EndIf

WinWaitActive("Foxit Reader Install Wizard", "Click Install to continue with the installation")

Send("!i")

WinWait("Foxit Reader Install Wizard", "Setup has successfully installed")

If Not WinActive("Foxit Reader Install Wizard", "Setup has successfully installed") Then

WinActivate("Foxit Reader Install Wizard", "Setup has successfully installed")

EndIf

WinWaitActive("Foxit Reader Install Wizard", "Setup has successfully installed")

ControlClick("Foxit Reader Install Wizard", "Setup has successfully installed", 1008)

Send("!f")

Thanks

Share this post


Link to post
Share on other sites



try:

WinWait("Apri file - Avviso di protezione", "Eseguire il file?")
WinActivate("Apri file - Avviso di protezione", "Eseguire il file?")
WinWaitActive("Apri file - Avviso di protezione", "Eseguire il file?")

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I do not get the 1st apearing for me, just use a WinWait is enough for the following ControlClick.

This is what I just made up and works fine. I added Adlib to handle your extra window and you may need to confirm the ClassnameNN in the function.

AdlibEnable("_Adlib")

$pid = Run(@ScriptDir & "\foxitreadersetup.exe")

$title = "Foxit Reader Install Wizard"

WinWait($title, "Setup will install Foxit Reader")
WinMove($title, "Setup will install Foxit Reader", 0, @DesktopWidth)
ControlClick($title, "Setup will install Foxit Reader", "Button1")

AdlibDisable()

WinWait($title, "Please read the license terms")
ControlClick($title, "Please read the license terms", "Button1")

WinWait($title, "Please select an installation type")
ControlClick($title, "Please select an installation type", "Button1")

WinWait($title, "Click Install to continue")
ControlClick($title, "Click Install to continue", "Button1")

WinWait($title, "Setup has successfully installed")
ControlCommand($title, "Setup has successfully installed", "Button2", "UnCheck")
ControlClick($title, "Setup has successfully installed", "Button1")

ProcessWaitClose($pid)

Func _Adlib()
    If WinExists("Apri file - Avviso di protezione", "Eseguire il file?") Then
        ControlClick("Apri file - Avviso di protezione", "Eseguire il file?", "Button1")
    EndIf
EndFunc

Fancy useless installers. I pack the standalone file into a Inno Setup installer so I can just silent install the thing.

;)

Edited by MHz

Share this post


Link to post
Share on other sites

Thanks to all!

I tried the script suggested by Mhz and it works!

Now I have to underdstand why it works!? ;)

Can you explain me what previously was bad?

Now I am going to re-use the script with other programs.

As for the Googemyster suggestions: before writing in this forum i have tried several kinds of command, Button commands, controlclicks with controlIDs, send command, enter ones, but the script always paused at the same point.

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