Sign in to follow this  
Followers 0
w0uter

ZIP updater.

6 posts in this topic

#1 ·  Posted (edited)

since i dislike AutoUpdateIt.au3

(due to that it does not download zip files)

i made this.

NEW CODE:

(also attached an .exe so that it can be used to update NON-beta versions)

If Ping("www.autoitscript.com") = 0 Then
    MsgBox(0, 'ERROR', 'Could not contact:' & @CRLF & '"http://www.autoitscript.com"')
    Exit
EndIf

$v_HTTP = ObjCreate ("winhttp.winhttprequest.5.1")
$v_HTTP.open ("GET", 'http://www.autoitscript.com/autoit3/files/beta/autoit/')
$v_HTTP.send ()
$v_HTTP = $v_HTTP.Responsetext

$v_HTTP = StringRegExp($v_HTTP, '"AutoIt3\.1\.1\.(.*?)\.zip"', 3)

If @extended = 0 Then
    MsgBox(0, 'ERROR', 'RegExp failure.')
    Exit
EndIf

$v_HTTP = $v_HTTP[UBound($v_HTTP) - 1]

$v_DL = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir")

If $v_DL = "" Then
    $v_DL = MsgBox(3, 'ERROR', 'Could not find the standard AutoItDir.' & @CRLF & @CRLF & 'Do you want to specify it yourself ?' & @CRLF & @CRLF & 'YES       =   Select folder.' & @CRLF & 'NO        =   Just download.' & @CRLF & 'CANCLE   =   Exit script.')
    If $v_DL = 6 Then $v_DL = FileSelectFolder("Choose the standard AutoItDir.", "")
    If $v_DL = 2 Then Exit
    If $v_DL = 7 Then $v_DL = ''
EndIf

If $v_DL <> "" Then
    
    If FileExists($v_DL & '\beta\AutoIt3.exe') Then
        If StringRight(FileGetVersion($v_DL & '\beta\AutoIt3.exe'), StringLen($v_HTTP)) = $v_HTTP Then
            MsgBox(0, 'ERROR', 'Matched the version number on:' & @CRLF & $v_DL & '\beta\AutoIt3.exe')
            Exit
        EndIf
    EndIf
    
    If FileExists($v_DL & '\AutoIt3.exe') Then
        If StringRight(FileGetVersion($v_DL & '\AutoIt3.exe'), StringLen($v_HTTP)) = $v_HTTP Then
            MsgBox(0, 'ERROR', 'Matched the version number on:' & @CRLF & $v_DL & '\AutoIt3.exe')
            Exit
        EndIf
    EndIf
    
EndIf

InetGet("http://www.autoitscript.com/autoit3/files/beta/autoit/AutoIt3.1.1." & $v_HTTP & '.zip', @TempDir & '\AutoIt3.1.1.' & $v_HTTP & '.zip', 1, 1)

$v_DL = InetGetSize('http://www.autoitscript.com/autoit3/files/beta/autoit/AutoIt3.1.1.' & $v_HTTP & '.zip')

TrayTip('Completion:', '0 %', 10)

While @InetGetActive
    TrayTip('Completion:', Int(@InetGetBytesRead / $v_DL * 100) & ' %', 10, 16)
    Sleep(250)
WEnd

TrayTip('Completion:', '100 %', 10)
Sleep(1000)

RunWait(@ComSpec & ' /c start ' & @TempDir & '\AutoIt3.1.1.' & $v_HTTP & '.zip', '', @SW_HIDE)

it only use's 2 variables

$v_HTTP for the core functions

$i_HTTP for the percentage calculation.

Update.rar

Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Share this post


Link to post
Share on other sites



Well, I had to reinstall the public version, then overwrite again with .54. Ran your script, oh so beautiful!

Nicely done!


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

Well I use .zip updates too and wrote a new Update applicatipn that can use these files as well as to make an library of previous updates to reinstall - works pretty well and free to download...

download at site:

http://www.sitecenter.dk/latenight/nss-fol...e/Au3Update.exe

The application come with source code, installer/uninstaller and a topics...

kjactive :)

Share this post


Link to post
Share on other sites

since i dislike AutoUpdateIt.au3

(due to that it does not download zip files)

<{POST_SNAPBACK}>

Not sure i understand the purpose... your script downloads the latest BETA ZIP file and then unzips it, but don't understand what this gives you on top of the standard AutoUpdateIt.au3 ?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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