kerrycorcoran Posted October 30, 2009 Posted October 30, 2009 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
Moderators Melba23 Posted October 30, 2009 Moderators Posted October 30, 2009 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 WEndThe 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
PsaltyDS Posted October 30, 2009 Posted October 30, 2009 Did you try the example script in the help file? 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
kerrycorcoran Posted October 31, 2009 Author Posted October 31, 2009 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?
PsaltyDS Posted October 31, 2009 Posted October 31, 2009 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
kerrycorcoran Posted November 2, 2009 Author Posted November 2, 2009 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")NextProgressSet(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?
PsaltyDS Posted November 2, 2009 Posted November 2, 2009 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
kerrycorcoran Posted November 2, 2009 Author Posted November 2, 2009 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.
Bowmore Posted November 2, 2009 Posted November 2, 2009 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. expandcollapse popupProgressOn("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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now