tharris Posted March 26, 2008 Share Posted March 26, 2008 (edited) I have been tasked with rolling out multiple pieces of software. I am attempting to create an autoit script that will install one piece of software, then go to the next install, and so on until it is complete. I also want to show the user some type of progress bar. What I have created in my test doesn't actually show the progress. It just scrolls from from left to right the entire time. Then once it completes that box will go away and be replaced with a gui that has a button to reboot. The main 2 issues that I am having is it won't run the script while the progress bar is up and for some reason it is attempting to run all 3 installs at once. Any help would be greatly appreciated. CODE#include <GUIConstants.au3> ;Global Const $PBS_MARQUEE = 0x00000008; The progress bar moves like a marquee Global $i=0 ; Create GUI $Form1 = GUICreate("Install in Progess", 220,60,100,200) $Progress1 = GUICtrlCreateProgress(10, 10, 200, 30, $PBS_MARQUEE) GUISetState() AdlibEnable("Advance", 50) ; Loop until user exits do until GUIGetMsg() = $GUI_EVENT_CLOSE Func Advance() $i=$i+1 GUICtrlSetData($Progress1, $i) If $i = 100 Then $i = 0 EndFunc FileInstall ("C:\test\CitrixWebClient.msi", "c:\Software\",1) FileInstall ("C:\test\EDSMR11.exe", "c:\Software\",1) FileInstall ("C:\test\SPA_Sales.exe", "c:\Software\",1) ;EDSM Install RunWait ("c:\software\EDSMR11.exe --silent --ssf: servername --uninstr4") ;Citrix Install ShellExecuteWait ("c:\software\CitrixWebClient.msi", "-passive") ;Sygate Install RunWait ("c:\software\SPA_Sales.EXE") GUIDelete ($Form1) $Form1_1 = GUICreate("Installation Complete", 318, 112, 193, 125) $Button1 = GUICtrlCreateButton("Reboot Now", 56, 24, 177, 49, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Case $nMsg = $Button1 Shutdown (2) Exit EndSwitch WEnd Edited March 26, 2008 by tharris Link to comment Share on other sites More sharing options...
Swift Posted March 26, 2008 Share Posted March 26, 2008 This is because, you do not want to adlibenable the progress... you want to do somehting like this: expandcollapse popup#include <GUIConstants.au3> ;Global Const $PBS_MARQUEE = 0x00000008; The progress bar moves like a marquee Global $i=0 ; Create GUI $Form1 = GUICreate("Install in Progess", 220,60,100,200) $Progress1 = GUICtrlCreateProgress(10, 10, 200, 30, $PBS_MARQUEE) GUISetState() do until GUIGetMsg() = $GUI_EVENT_CLOSE FileInstall ("C:\test\CitrixWebClient.msi", "c:\Software\",1) FileInstall ("C:\test\EDSMR11.exe", "c:\Software\",1) FileInstall ("C:\test\SPA_Sales.exe", "c:\Software\",1) ;EDSM Install RunWait ("c:\software\EDSMR11.exe --silent --ssf: ssfxfgo4.fxfeast.freight.fedex.com --uninstr4") GUICtrlSetData($Progress1, 33) ;Citrix Install ShellExecuteWait ("c:\software\CitrixWebClient.msi", "-passive") GUICtrlSetData($Progress1, 66) ;Sygate Install RunWait ("c:\software\SPA_Sales.EXE") GUICtrlSetData($Progress1, 100) GUIDelete ($Form1) $Form1_1 = GUICreate("Installation Complete", 318, 112, 193, 125) $Button1 = GUICtrlCreateButton("Reboot Now", 56, 24, 177, 49, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Case $nMsg = $Button1 Shutdown (2) Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
tharris Posted March 26, 2008 Author Share Posted March 26, 2008 The technique you mentioned is one I have used in the past for other installs. I was hoping to be able to set some sort of a scrolling bar. The only reason I say this is because one install will take 10-15 minutes and the others will only take a couple. If I set the progress bar like this most users will close it off because they will think it is hung. Link to comment Share on other sites More sharing options...
Swift Posted March 26, 2008 Share Posted March 26, 2008 Then maybe during this installer, after each install make it adlib enable, going back and forth only from 0-33, and then the next time, 0-66, etc. until its finished, that may make it look better, and may look like its actually installing. Link to comment Share on other sites More sharing options...
tharris Posted March 26, 2008 Author Share Posted March 26, 2008 (edited) Thanks. I will try this. This part of the script doesn't serve any purpose other than showing the user that something is going on. Edited March 26, 2008 by tharris Link to comment Share on other sites More sharing options...
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