Jump to content

Recommended Posts

Hi,  i'm recording a setup for a program using mouse clicks , however, the problem is when the setup installs (the progress bar showing) the auto generated script by the recorder will not have a winwait() or sleep() to click the "finish" button when the setup is completed. is there anyway to  do that automatically?

Link to comment
Share on other sites

Keep waiting for finish button to detect, using its title text.

 

May be like this.

 

$time_out = 120

Func _WinWaitActivate($title,$text,$timeout=$time_out)
    ;Logging("Waiting for "&$title&":"&$text)
    $dHandle = WinWait($title,$text,$timeout)
    if not ($dHandle = 0) then
        If Not WinActive($title,$text) Then WinActivate($title,$text)
        WinWaitActive($title,$text,$timeout)
    Else
        ;Logging("Timeout occured while waiting for the window...")
        Exit
    EndIf
EndFunc

_WinWaitActivate($win1,"Ready to Install the")

 

Edited by ur
Link to comment
Share on other sites

max23ed, you should to look into silent switches for installers. You can run an installer with code like this:

shellexecute("myprogram.exe", "/silent")

This method would be more stable, install faster and more professional looking than having a script clicking 'next' buttons.

The above example works with installers that were compiled with Inno Setup (the /silent part is the switch - you can also use /verysilent to install with no progress bar). There are other software installers with their own switches. Most big software companies provide what are called "command line switches" in their documentation or FAQ sections. If you can't find them online, you can email them to see if they are supported and what they are, if supported.

Many years ago, I posted an example script that installed software using silent switches. You might want to look at it as an example (the config.ini section has many software switches listed).

I hope this helps!

My software installer:

 

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

×
×
  • Create New...