Sign in to follow this  
Followers 0
kerrycorcoran

Newbie Question - Progress?

9 posts in this topic

I have created an AU3 script that automates a software installation; takes approximately 4 minutes for the installation to complete. When the script starts I have a splash screen describing the installation. I have this working without issue.

How would I include a progress bar to run on the screen? I found the ProgressOn Command, but not sure how to make it run while the software installs.

Any insight appreciated.

Thanks,

Kerry

Share this post


Link to post
Share on other sites



kerrycorcoran,

If you are not worried about the exact timing, you can use a Marquee style progress bar like this:

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>

$hGUI = GUICreate("Test", 500, 500)

GUICtrlCreateProgress(10, 10, 200, 20, $PBS_MARQUEE)
_SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 50)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

The final parameter of the message is the update speed in ms. You will, of course, have to make a small GUI to replicate the one provided by the Progress* functions because I do not believe that they support the Marquee style (sits back and waits to be proved wrong! :) ).

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thanks for the information guys!

I need to clarify, I found the Progress bar in the examples, and I figured out how to set the time. My Question is how to I have that Progress Bar display while my program is installed using my AU3 script. At this point the Progress Bar runs, then goes to the next step in my script which is installing the application. I want the Progress bar to start and want my program to install while the progress bar progresses. Make sense? Do I need to create a separate script in my inital script to call the progress bar and it runs seperately?

Share this post


Link to post
Share on other sites

Thanks for the information guys!

I need to clarify, I found the Progress bar in the examples, and I figured out how to set the time. My Question is how to I have that Progress Bar display while my program is installed using my AU3 script. At this point the Progress Bar runs, then goes to the next step in my script which is installing the application. I want the Progress bar to start and want my program to install while the progress bar progresses. Make sense? Do I need to create a separate script in my inital script to call the progress bar and it runs seperately?

So, what is your script doing while the application install is happening? During that time you should be updating the progress bar.

For example, if you kick of the install with a RunWait(), use just Run() instead and go into a loop that waits for the process to complete while updating the progress bar.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

So, what is your script doing while the application install is happening? During that time you should be updating the progress bar.

For example, if you kick of the install with a RunWait(), use just Run() instead and go into a loop that waits for the process to complete while updating the progress bar.

:)

That's what I'm trying to do, just not sure how to accomplish that. Here is a my testing script.

ProgressOn("Progress Meter", "Increments every second", "0 percent")

For $i = 10 to 100 step 10

sleep(500)

ProgressSet( $i, $i & " percent")

Next

ProgressSet(100 , "Done", "Complete")

Run ("notepad")

WinActive ("Untitled - Notepad")

Send ("This is a test")

Send ("{enter}")

sleep (1000)

Send ("This is a test")

Send ("{enter}")

sleep (1000)

Send ("This is a test")

Send ("{enter}")

sleep (1000)

Send ("This is a test")

Send ("{enter}")

sleep (1000)

Send ("This is a test")

Send ("{enter}")

sleep (1000)

sleep(500)

ProgressOff()

Can you show me how I'd have the Progress bar running while the script is running the test typing?

Share this post


Link to post
Share on other sites

You are completing the loop for the progress bar before you start the install. While the install is being done, nothing is updating the progress bar. You might want to just update the progress bar with an AdLib function instead.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

You are completing the loop for the progress bar before you start the install. While the install is being done, nothing is updating the progress bar. You might want to just update the progress bar with an AdLib function instead.

;)

Again, Newbie here.. :) If you could elaborate that would help. I am just trying to have something that shows progress (based on a set time I configure in the script) while the scripted installation of the software completes.

Share this post


Link to post
Share on other sites

Again, Newbie here..  :) If you could elaborate that would help.  I am just trying to have something that shows progress (based on a set time I configure in the script) while the scripted installation of the software completes.

I've modified the script you posted to show you the basic method to use for updating a progress bar in that type of situation. 

ProgressOn("Progress Meter", "Increments every second", "0 percent")
sleep(500)
ProgressSet( 0, 0 & " percent")

Run ("notepad")
WinWaitActive("Untitled - Notepad")
Send ("This is a test")
Send ("{enter}")
ProgressSet( 20, 20 & " percent")
sleep (1000)

WinActivate ("Untitled - Notepad")
Send ("This is a test")
Send ("{enter}")
ProgressSet( 40, 40 & " percent")
sleep (1000)

WinActivate ("Untitled - Notepad")
Send ("This is a test")
Send ("{enter}")
ProgressSet( 60, 60 & " percent")
sleep (1000)

WinActivate ("Untitled - Notepad")
Send ("This is a test")
Send ("{enter}")
ProgressSet( 80, 80 & " percent")
sleep (1000)

WinActivate ("Untitled - Notepad")
Send ("This is a test")
Send ("{enter}")
ProgressSet( 100, 100 & " percent")
sleep (1000)

ProgressSet(100 , "Done", "Complete")
sleep(500)
ProgressOff()

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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