Jump to content

simple progressbar during installation


Recommended Posts

I need a progress bar to show during installation of my applications. from the help file this is what i managed to come up with. Thank you for your help

while 1 
ProgressOn("Progress Bar", "Sample progress bar", "Working...")

For $i = 0 To 100
    ProgressSet($i)
    Sleep(5)
Next

ProgressSet(100, "Done!")
Sleep(750)
ProgressOff()

runwait("applications\" & $dir & "\autosetup.au3","applications\" & $dir)   wend
Edited by goodbyeplanet
Link to comment
Share on other sites

Your progress bar is done before you even kick off the run.

ja sure i have also tried below but i am kinda confused where i should position my runwait statement. sorry i am still learning autoit
while 1 
ProgressOn("Progress Bar", "Sample progress bar", "Working...")

For $i = 0 To 100
runwait("applications\" & $dir & "\autosetup.au3","applications\" & $dir)
    ProgressSet($i)
    Sleep(5)
Next

ProgressSet(100, "Done!")
Sleep(750)
ProgressOff()

   wend
Link to comment
Share on other sites

you have several solutions for follow progress install

by output give by installer, time if you know it or directory size...

like that Posted Image

#include <Math.au3>

; simulation of the freeware FairStars CD Ripper Installation ( http://www.fairstars.com/download/fscdripper_setup.exe )
; dirgetsize of @ProgramFilesDir & '\FairStars CD Ripper' give 6331609 bits after install.

$_Pid = Run ( @DesktopDir & '\fscdripper_setup.exe /VERYSILENT /SP-' ) 
ProgressOn ( "Progress Bar", "Install of FairStars CD Ripper", "Working..." )
While ProcessExists ( $_Pid )
    $_DirSize = DirGetSize ( @ProgramFilesDir & '\FairStars CD Ripper' )
    If $_DirSize Then
        $_Percent = $_DirSize*100/6331609
        $_Percent = _Max ( _Min ( $_Percent, 99 ), 1 )
        ProgressSet ( $_Percent )
    EndIf
    Sleep ( 100 )
WEnd

ProgressSet ( 100, "Done !" )
Sleep ( 2000 )
ProgressOff ( )

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...