Sign in to follow this  
Followers 0
Venigo^

File Dwonloader / Updater.

12 posts in this topic

Hello,

I'm making a file updater/download but i can't see the progress bar.

It download's the files and he shows also the current version.

But it shows not the progress bar,

What im doing wrong?

InetGet("http://www.lima-cs.nl/lp/update.ini","update.ini",1)

$ver = IniRead("update.ini","DLL","version",0)

$curr_ver = IniRead("current.ini","DLL","version",0)

    
If $ver > $curr_ver Then
    InetGet("http://www.lima-cs.nl/lp/steam.dll", "steam.dll", 1, 0)  
    InetGet("http://www.lima-cs.nl/lp/steamemu.ini", "steamemu.ini", 1, 0)
    InetGet("http://www.lima-cs.nl/lp/steamapps.ini", "steamapps.ini", 1, 0)
        
    While @InetGetActive
        
$FileSize1 = InetGetSize("http://www.lima-cs.nl/lp/steam.dll")
$FileSize2 = InetGetSize("http://www.lima-cs.nl/lp/steamemu.ini")
$FileSize3 = InetGetSize ("http://www.lima-cs.nl/lp/steamapps.ini")
$filedownload = round(@InetGetBytesRead/1048576, 5)
$Percent = $filedownload/$FileSize1/$FileSize2/$FileSize3
ProgressOn("LimA Productions - Updating","Updating right now...")
ProgressSet($Percent,"Downloaded - " & $filedownload & " Mb")
TrayTip("Downloading...", "Downloaded = " & $filedownload & " Mb", 10, 16)
Sleep(500)
Wend

    IniWrite("current.ini","DLL","version",$ver)
    ProgressOff()
    Else
    
    TrayTip("Newest version","You have currently the newest version!",10)
    
    Sleep(2000)
EndIf

Share this post


Link to post
Share on other sites



Nobody who can help me?

Share this post


Link to post
Share on other sites

you did not read the help file correctly

you can only download one file at a time...

********** not tested

InetGet("http://www.lima-cs.nl/lp/update.ini", "update.ini", 1)

$ver = IniRead("update.ini", "DLL", "version", 0)

$curr_ver = IniRead("current.ini", "DLL", "version", 0)


If $ver > $curr_ver Then
    wait_active("http://www.lima-cs.nl/lp/steam.dll", "steam.dll")
    Sleep(500)
    wait_active("http://www.lima-cs.nl/lp/steamemu.ini", "steamemu.ini")
    Sleep(500)
    wait_active("http://www.lima-cs.nl/lp/steamapps.ini", "steamapps.ini")
Else
    TrayTip("Newest version", "You have currently the newest version!", 10)
    Sleep(2000)
EndIf

Func wait_active($file, $name)
    
    $FileSize1 = InetGetSize($file)
    InetGet($file, $name, 1, 1)
    ProgressOn("LimA Productions - Updating", "Updating right now...")
    While @InetGetActive
        
        $filedownload = Round(@InetGetBytesRead / 1048576, 5)
        $Percent = $filedownload / $FileSize1
        
        ProgressSet($Percent, "Downloaded - " & $filedownload & " Mb")
        TrayTip("Downloading...", "Downloaded = " & $filedownload & " Mb", 10, 16)
        Sleep(250)
    WEnd
    
    IniWrite("current.ini", "DLL", "version", $ver)
    ProgressOff()
    Sleep(500)
EndFunc  ;==>wait_active

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks mate it works :D

Another question how do i make a windows with a button check for updates and then show a progress bar?

Greets.

Edited by Venigo^

Share this post


Link to post
Share on other sites

Thanks mate it works :D

Another question how do i make a windows with a button check for updates and then show a progress bar?

Greets.

as you did before...

you try, i help

i dont just write scripts ( all the time )

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

as you did before...

you try, i help

i dont just write scripts ( all the time )

8)

But how do i make a window with a button?

8)

Share this post


Link to post
Share on other sites

click "welcome to Autoit 1-2-3" below

this will help you tremendously

get beta and SciTE editor... and learn alot quickly

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

click "welcome to Autoit 1-2-3" below

this will help you tremendously

get beta and SciTE editor... and learn alot quickly

8)

I have the scite editor :P.

I will read today that topic.

Ty.

Greetings.

Edit:

I have followed the tool but i still don't know how to make a windows etc :D.

Im now gonna sleep :D.

Seeu @ mid day

Edited by Venigo^

Share this post


Link to post
Share on other sites

I have it working,

But the windows open only is i sleect one second i want it to op 3 micro seconds..

My code for now:

#include <GUIConstants.au3>

Opt("GUIOnEventMode",1)

GUICreate("Steam emu updater - LimA Productions", 210, 80)

$Label = GUICtrlCreateLabel("Dow you want to Update the Steam emu?", 10, 10)
$YesID  = GUICtrlCreateButton("Yes", 10, 50, 50, 20)
GUICtrlSetOnEvent($YesID,"OnYes")
$NoID   = GUICtrlCreateButton("No", 80, 50, 50, 20)
GUICtrlSetOnEvent($NoID,"OnNo")
$ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)
GUICtrlSetOnEvent($ExitID,"OnExit")

GUISetOnEvent($GUI_EVENT_CLOSE,"OnExit")

GUISetState() ; display the GUI

While 1
   Sleep (1000)
WEnd

;--------------- Functions ---------------
Func OnYes()
    MsgBox(0,"Steam emu updater - LimA Productions", "Updating...", "0,2")
    
    InetGet("http://www.lima-cs.nl/lp/update.ini", "update.ini", 1)
$ver = IniRead("update.ini", "DLL", "version", 0)

$curr_ver = IniRead("current.ini", "DLL", "version", 0)

If $ver > $curr_ver Then
    wait_active("http://www.lima-cs.nl/lp/steam.dll", "steam.dll")
    Sleep(500)
    wait_active("http://www.lima-cs.nl/lp/steamemu.ini", "steamemu.ini")
    Sleep(500)
    wait_active("http://www.lima-cs.nl/lp/steamapps.ini", "steamapps.ini")
Else
    TrayTip("Newest version", "You have currently the newest version!", 10)
    Sleep(2000)
EndIf

    IniWrite("current.ini", "DLL", "version", $ver)
    
EndFunc)

Func OnNo()
    if @GUI_CtrlId = $NoID Then
        MsgBox(0,"Steam emu updater - LimA Productions", "The steam emu updater will be closed.", "0,6")
    Else
        MsgBox(0,"Steam emu updater - LimA Productions", "It wil be closed now", "0,6")
        Endif
        
        Exit
EndFunc)

Func OnExit()
    if @GUI_CtrlId = $ExitId Then
        MsgBox(0,"Steam emu updater - LimA Productions", "The updater will now Exit", "0,6")
    Else
        MsgBox(0,"Steam emu updater - LimA Productions", "The updater will now be Closed", "0,6")
    EndIf

    Exit
EndFunc

Func wait_active($file, $name)
    
    $FileSize1 = InetGetSize($file)
    InetGet($file, $name, 1, 1)
    ProgressOn("LimA Productions - Updating", "Updating right now...")
    While @InetGetActive
        
        $filedownload = Round(@InetGetBytesRead / 1048576, 5)
        $Percent = $filedownload / $FileSize1
        
        ProgressSet($Percent, "Downloaded - " & $filedownload & " Mb")
        TrayTip("Downloading...", "Downloaded = " & $filedownload & " Mb", 10, 16)
        Sleep(250)
    WEnd
    
    ProgressOff()
    Sleep(500)
EndFunc ;==>wait_active

Greets.

Share this post


Link to post
Share on other sites

Nobody who can tell how i must use micro seconds?

Share this post


Link to post
Share on other sites

Nobody who can tell how i must use micro seconds?

Sleep (1000) ; Sleep for 1 second

Sleep (30000) ; Sleep for 30 seconds

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Nobody who can tell how i must use micro seconds?

Use this:

1 second = 1000ms

10 seconds = 10000ms

100 secs = 100000ms

You can multiply it with 1000:

10 seconds*1000 = 10000ms.

Here is help utilly:

$input=InputBox("Transforming","Enter number of seconds to convert in microseconds")
$result = $input*1000
MsgBox(64,"Transformed",$input &" second(s) = " & $result & " microseconds.")
;***** not tested *****

i542

EDIT: Is that helped?

Edited by i542

I can do signature me.

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
Sign in to follow this  
Followers 0