Jump to content

Get setup file progress bar percentage

Recommended Posts


I run a setup file and want when progress percentage is equal to  50, show me a message.
I searched in forum and found some code that didn't work. I wrote this code and my problem is GUICtrlRead() only work with autoit controls. I need a solution for read value form outside controls. dose anyone know how can fix this problem?


;local variables
Local Const $title = "Setup"
Local $setup = @ScriptDir & "\mysetup.exe"

; run Setup file
Run($setup, "", @SW_HIDE)

While 1
    local $hwnd = WinWaitActive($title)
    local $gethandle = ControlGetHandle($hwnd, "", "[CLASS:ProgressBar; INSTANCE:1]")
    local $precent = GUICtrlRead($gethandle)
    ConsoleWrite("Precent is: " & $precent & @CRLF)



Edited by behdadsoft
Link to post
Share on other sites

it would be easier if you could extract the files from mysetup.exe and install them with your autoit script by using fileinstall.

depending on the type of installer you can find out exactly what it does and let your script do it instead. Then you will be able to make your own progressbar and monitor it from within your own script.

I'm afraid it's not possible the way you would like it.

A way that I could think of would be to use imagesearch and monitor the progress bar by color checking the progress bar itself (pixel searching). 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...