Jump to content
DigDeep

ProgressBar

Recommended Posts

DigDeep

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()

 

 

Share this post


Link to post
Share on other sites
VIP

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,
 

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

×