Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

InetGet Corrupt file

$
0
0
Hi there! i am trying to use this script

[ autoit ]         
$VersionsInfo = "[url="https://dl-web.dropbox.com/get/Version.ini?w=AAC8XLGvS9VVbZ4ivvsC9L_rjqxUL0FuH7pbMzQWJeQQ4A"]https://dl-web.dropbox.com/get/Version.ini?w=AAC8XLGvS9VVbZ4ivvsC9L_rjqxUL0FuH7pbMzQWJeQQ4A[/url]" $oldVersion = IniRead("updater.ini","Version","Version","NotFound") $newVersion = "0.0" $Ini = InetGet($VersionsInfo,@ScriptDir & "\version.ini") ;download version.ini If $Ini = 0 Then ;was the download of version.ini successful? MsgBox(0,"ERROR","The server seems to be offline.") Else $newVersion = IniRead (@ScriptDir & "\version.ini","Version","Version","") ;reads the new version out of version.ini If $NewVersion = $oldVersion Then ;compare old and new MsgBox (0,"No update","There is no update available!") Else $msg = MsgBox (4,"Update","There is a new version existing: " & $newVersion & " ! You are using: " & $oldVersion & ". Do you want to download the new version?") If $msg = 7 Then ;No was pressed FileDelete(@ScriptDir & "\version.ini") Exit ElseIf $msg = 6 Then ;OK was pressed $downloadLink = IniRead(@ScriptDir & "\version.ini","Version","download","NotFound") $dlhandle = InetGet($downloadLink,@ScriptDir & "\Update.rar",1,1) ProgressOn("", "", "",-1,-1,16) ;creates an progressbar $Size = InetGetSize($downloadLink,1) ;get the size of the update While Not InetGetInfo($dlhandle, 2) $Percent = (InetGetInfo($dlhandle,0)/$Size)*100 ProgressSet( $Percent, $Percent & " percent");update progressbar Sleep(1) WEnd ProgressSet(100 , "Done", "Complete");show complete progressbar sleep(500) ProgressOff() ;close progress window IniWrite("updater.ini","version","version",$NewVersion) ;updates update.ini with the new version InetClose($dlhandle) MsgBox(-1,"Success","Download Complete!") EndIf EndIf EndIf FileDelete(@ScriptDir & "\version.ini") Exit


But, when i compile it and execute it, the file seems to be corrupted.

Thanks in advantage.

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>