allSystemsGo Posted March 18, 2013 Share Posted March 18, 2013 (edited) What am I missing here? Currently it downloads the whole file but is stuck on the gui at 2%...Script does not go any further because it does not know its done... expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <Process.au3> #include <zip.au3> #include <GUIStatusBar.au3> #include <ProgressConstants.au3> #include <Timers.au3> Func checkBlat() $os_arch_type = @OSArch global $aParts[3] = [100, 200, -1] $getBlatGUI = GUICreate("Download Blat", 300, 100) $hStatusBar = _GUICtrlStatusBar_Create($getBlatGUI, $aParts) _GUICtrlStatusBar_SetText($hStatusBar,@TAB & $os_arch_type) $probar = GUICtrlCreateProgress(60, 20, 180, 25) GUISetState() If $os_arch_type = 'X64' Then If FileExists(@ScriptDir & "\blat300_64full.zip") Then Sleep(500) Else $size = InetGetSize("http://downloads.sourceforge.net/project/blat/Blat%20Full%20Version/64%20bit%20versions/Blat%20v3.0.0/blat300_64.full.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fblat%2Ffiles%2FBlat%2520Full%2520Version%2F64%2520bit%2520versions%2FBlat%2520v3.0.0%2F&ts=1363289367&use_mirror=hivelocity") $TotalSize = Round($size / 1024) $dl=InetGet("http://downloads.sourceforge.net/project/blat/Blat%20Full%20Version/64%20bit%20versions/Blat%20v3.0.0/blat300_64.full.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fblat%2Ffiles%2FBlat%2520Full%2520Version%2F64%2520bit%2520versions%2FBlat%2520v3.0.0%2F&ts=1363289367&use_mirror=hivelocity", @ScriptDir & "\blat300_64full.zip") ;$size = InetGetSize("http://downloads.sourceforge.net/project/blat/Blat%20Full%20Version/64%20bit%20versions/Blat%20v3.0.0/blat300_64.full.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fblat%2Ffiles%2FBlat%2520Full%2520Version%2F64%2520bit%2520versions%2FBlat%2520v3.0.0%2F&ts=1363289367&use_mirror=hivelocity") Do $sec = @SEC $Bytes = Round(InetGetInfo($dl, 0)) While @SEC = $sec Sleep(10) If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd $CalBytes = Round(InetGetInfo($dl, 0)) $TotalSize = $TotalSize - (($CalBytes - $Bytes) / 1024) $Percentage = Round($TotalSize / $size * 100000) $Percentage = 100 - $Percentage _GUICtrlStatusBar_SetText($hStatusBar, "Downloading...") _GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & $Percentage & "%" & @CRLF, 2) GUICtrlSetData($probar, $Percentage) Until InetGetInfo($dl, 2) $fZipFile = @ScriptDir & "\blat300_64full.zip" $fDestPath = @ScriptDir & "\blat300_64full" _zip_unzipall($fZipFile, $fDestPath) FileCopy(@ScriptDir & "\blat300_64full\blat300\full\blat.dll", @ScriptDir & "\blat.dll") FileCopy(@ScriptDir & "\blat300_64full\blat300\full\blat.exe", @ScriptDir & "\blat.exe") EndIf Else If FileExists(@ScriptDir & "\blat311_32.zip") Then Sleep(500) Else $size=InetGetSize("http://downloads.sourceforge.net/project/blat/Blat%20Full%20Version/32%20bit%20versions/Win2000%20and%20newer/blat311_32.full.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fblat%2Ffiles%2FBlat%2520Full%2520Version%2F32%2520bit%2520versions%2FWin2000%2520and%2520newer%2F&ts=1363289976&use_mirror=iweb") $TotalSize = Round($size / 1024) $dl=InetGet("http://downloads.sourceforge.net/project/blat/Blat%20Full%20Version/32%20bit%20versions/Win2000%20and%20newer/blat311_32.full.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fblat%2Ffiles%2FBlat%2520Full%2520Version%2F32%2520bit%2520versions%2FWin2000%2520and%2520newer%2F&ts=1363289976&use_mirror=iweb", @ScriptDir & "\blat311_32.zip") ;$size=InetGetSize("http://downloads.sourceforge.net/project/blat/Blat%20Full%20Version/32%20bit%20versions/Win2000%20and%20newer/blat311_32.full.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fblat%2Ffiles%2FBlat%2520Full%2520Version%2F32%2520bit%2520versions%2FWin2000%2520and%2520newer%2F&ts=1363289976&use_mirror=iweb") Do $sec = @SEC $Bytes = Round(InetGetInfo($dl, 0)) While @SEC = $sec Sleep(10) If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd $CalBytes = Round(InetGetInfo($dl, 0)) $TotalSize = $TotalSize - (($CalBytes - $Bytes) / 1024) $Percentage = Round($TotalSize / $size * 100000) $Percentage = 100 - $Percentage _GUICtrlStatusBar_SetText($hStatusBar, "Downloading...") _GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & $Percentage & "%" & @CRLF, 2) GUICtrlSetData($probar, $Percentage) Until InetGetInfo($dl, 2) $fZipFile = $dl $fDestPath = @ScriptDir & "\blat311_32" _zip_unzipall($fZipFile, $fDestPath) FileCopy(@ScriptDir & "\blat311_32\blat311\full\blat.dll", @ScriptDir & "\blat.dll") FileCopy(@ScriptDir & "\blat311_32\blat311\full\blat.exe", @ScriptDir & "\blat.exe") EndIf EndIf EndFunc ;==>checkBlat Edited March 18, 2013 by zsutton92 Link to comment Share on other sites More sharing options...
Developers Jos Posted March 18, 2013 Developers Share Posted March 18, 2013 Add the background param to the InetGet(). Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
allSystemsGo Posted March 18, 2013 Author Share Posted March 18, 2013 Add the background param to the InetGet().JosWorks like a charm...thanks. 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