Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoTrayIcon
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_icon=Applic-Miranda.ico
- #AutoIt3Wrapper_UseUpx=n
- #AutoIt3Wrapper_UseX64=n
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <INet.au3>
- #include <String.au3>
- #include <Process.au3>
- If Not FileExists(@ScriptDir & "\miranda32.exe") Then
- MsgBox(16,"Error","Du hast den Updater falsch installiert" & @crlf & "Verschiebe diese Datei in dasselbe Verzeichnis wie die miranda32.exe")
- Exit
- EndIf
- If Not FileExists(@ScriptDir & "\7za.exe") Then
- MsgBox(16,"Error","Es fehlt die 7za.exe")
- Exit
- EndIf
- $src = _INetGetSource("http://update.miranda-im.org/update.xml")
- $atmv = FileGetVersion(@ScriptDir & "\miranda32.exe","ProductVersion")
- If StringInStr($atmv,"alpha") Then
- $newv1 = _StringBetween($src,"<releasealpha>",'</releasealpha>')
- $newv = _StringBetween($newv1[0],"<versionpublic>",'</versionpublic>')
- ElseIf StringInStr($atmv,"beta") Then
- $newv1 = _StringBetween($src,"<releasebeta>",'</releasebeta>')
- $newv = _StringBetween($newv1[0],"<versionpublic>",'</versionpublic>')
- Else
- $newv1 = _StringBetween($src,"<releasestable>",'</releasestable>')
- $newv = _StringBetween($newv1[0],"<versionpublic>",'</versionpublic>')
- EndIf
- $newv = $newv[0]
- $dlurl = _StringBetween($newv1[0],"<downloadunicodezip>","</downloadunicodezip")
- If $atmv <> $newv Then
- ProgressOn("","Update von " & $atmv & " auf " & $newv,"Vorgang wird initiiert",-1,-1,19)
- ProcessClose("miranda32.exe")
- DirCreate(@TempDir & "\mirupdate")
- $in = InetGet($dlurl[0],@TempDir & "\mirupdate\packed.7z",1,1)
- ProgressSet(0,"Download")
- Do
- $dlinf = InetGetInfo($in,-1)
- ProgressSet(($dlinf[0]/$dlinf[1])*100)
- Sleep(50)
- Until $dlinf[2]
- InetClose($in)
- ProgressOff()
- If Not FileExists(@TempDir & "\mirupdate\packed.7z") Or Not $dlinf[3] Then
- MsgBox(16,"Error","Update konnte nicht heruntergeladen werden" & @crlf & "Downloadpfad: " & $dlurl[0] & @crlf & @error)
- ShellExecute(@ScriptDir & "\miranda32.exe")
- Exit
- EndIf
- $query = "7za.exe x """ & @TempDir & "\mirupdate\packed.7z"" -o""" & @TempDir & "\mirupdate"" -aoa"
- _RunDOS($query)
- FileDelete(@TempDir & "\mirupdate\packed.7z")
- FileMove(@TempDir & "\mirupdate\*.*",@ScriptDir & "\*.*",1)
- FileMove(@TempDir & "\mirupdate\Icons\*.*",@ScriptDir & "\Icons\*.*",1)
- ShellExecute(@ScriptDir & "\miranda32.exe")
- Exit
- EndIf
- ShellExecute(@ScriptDir & "\miranda32.exe")
- Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement