DigDeep Posted June 6, 2016 Share Posted June 6, 2016 Hi, I am trying to get a ProgressBar to run along side when the files download / install. - Using the RUN option with the below code, the 'mcupdate.exe' launches with the code but the ProgressBar completes first and then the DAT update happens. - Using the RUNASWAIT option, the 'mcupdate.exe' launches with the code but the ProgressBar waits a long time to start as 0% and still completes first and then the DAT update happens. I have tried same with downloading / installing files but it happens as the above. Can someone please suggest how can I proceed so I can get both ProgressBar and download / install run at the same time? Thanks #RequireAdmin #include <ProgressConstants.au3> Global $McAfee_DAT_Update = 'C:\Program Files (x86)\McAfee\VirusScan Enterprise\mcupdate.exe' Func DAT() ProgressOn("Progress Bar", "Installing VLC Media Player...", "0%") Run(@ComSpec & ' /c "' & $McAfee_DAT_Update & '" /UPDATE /QUIET', "", @SW_HIDE) For $i = 0 To 100 Step 1 ProgressSet($i, $i & "%") Sleep(500) Next ProgressSet(100, "Done!") Sleep(500) ProgressOff() EndFunc DAT() Link to comment Share on other sites More sharing options...
Skysnake Posted June 7, 2016 Share Posted June 7, 2016 https://www.autoitscript.com/forum/topic/182390-how-to-call-next-function-after-completion-of-a-loop/#comment-1309848 See this link. Look at @Melba23's marquee solution. You may use a similar implementation. Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
Trong Posted June 7, 2016 Share Posted June 7, 2016 Bad solution: #RequireAdmin Global $McAfee_DAT_Update = 'C:\Program Files (x86)\McAfee\VirusScan Enterprise\mcupdate.exe' McAfee_DAT_Update() Func McAfee_DAT_Update() ProgressOn("Progress Bar", "Installing McAfee Antivirus...", "0%") Local $i,$iPID=Run('"' & $McAfee_DAT_Update & '" /UPDATE /QUIET', "", @SW_HIDE) While 1 $i+=0.5 ProgressSet($i, $i & "%") Sleep(1000) If Not ProcessExists($iPID) Then ExitLoop WEnd ProgressSet(100, "Done!") Sleep(500) ProgressOff() EndFunc ;==>DAT Regards, 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