Ich hab hier 2 Hauptfunktionen, eine die das Patching startet und eine die sagt Fertig gepatched.
Func Patchstarten:
Spoiler anzeigen
Func Patchstatus()
InetGet("http://www.Keanu-AutoIT.de/RisingGods/wowversion.txt", @TempDir & "\wowversion.txt")
$versionlocal = FileGetVersion($wowpath & "\WoW.exe")
Switch $versionlocal
Case "2.3.3.7799"
Patch1()
Case "2.4.0.8089"
Patch2()
Case "2.4.1.8125"
Patch3()
Case "2.4.2.8278"
Patch4()
Case "2.4.3.8606"
Patch5()
Case "3.0.1.8874"
Patch6()
Case "3.0.2.9056"
Patch7()
Case "3.2.0.10192"
Patch8()
Case "3.2.0.10314"
Patch9()
Case "3.2.2.10482"
Patch10()
Case "3.2.2.10505"
Patch11()
Case "3.3.0.10958"
Patch12()
Case "3.3.0.11159"
Patch13()
Case "3.3.2.11403"
Patch14()
Case "3.3.3.11685"
Patch15()
EndSwitch
EndFunc ;==>Patchstatus
Func Patchbeenden:
Spoiler anzeigen
Func Ende()
$versionlocal = FileGetVersion($wowpath & "\WoW.exe")
$versionextern = FileRead(@TempDir & "\wowversion.txt")
if $versionlocal = $versionextern then
return true
MsgBox(0, "", "Auf Rising Gods Stand gepatcht")
logfile("Patchstand Rising Gods: " & $versionlocal)
else
return false
Endif
Endfunc
Jetzt
will ich das nach jedem Patch die Funktion Patchbeenden aufgerufen wird, wenn die zutrifft soller nichts mehr machen, als ne msgbox mit fertig zu senden.
Falls nicht soll er wieder in die Funktion Patchstarten gehen und weiterpatchen. Nach jedem Patch werden beide Funktionen so abgefragt.
Ein Patch als Beispiel:
Spoiler anzeigen
Func Patch1() ;2.3.3.7799
$versionlocal = FileGetVersion($wowpath & "\WoW.exe")
logfile("Starte Patchvorgang : Schleife 2.3.3.7799 " & "Locale Version: " & $versionlocal)
Ping("www.wow.4fansites.de")
If @error Then
MsgBox(-1, $language[4], $language[51])
logfile("RG WoW Installer: Can't connect to http://www.wow.4fansites.de - " & @HOUR & ":" & @MIN & ":" & @SEC)
Else
$Error = 0
TrayTip("RG WoW Installer", "Patch 2.4 - Deutsch (2.3.3.7799 -> 2.4.0.8089) wird runtergeladen...", 5, 1)
$inetgethandle = InetGet("http://wow.4fansites.de/download.php?download=10037&mirror=1", $wowpath & "Patch 2.4 - Deutsch.zip", 1, 1)
$Size = InetGetSize("http://wow.4fansites.de/download.php?download=10037&mirror=1")
$Percent = $Size / 100
ProgressOn("Download of Patch 2.4 - Deutsch (2.3.3.7799 -> 2.4.0.8089)", "Size = " & $Size & " Bytes", "0%")
For $i = 0 To 100 Step 1
While 1
If InetGetInfo($inetgethandle, 0) >= $Percent * $i - 1 Then
ProgressSet($i, $i & "%")
Sleep(100)
If $i == 100 Then
ProgressOff()
EndIf
ExitLoop
ElseIf InetGetInfo() == "" Then
ProgressSet(100, $language[4], $language[22])
ProgressOff()
MsgBox(-1, $language[4], $language[21])
logfile("Patch Download: DL NOT succesfull - Patch 2.4 - Deutsch 2.3.3.7799 -> 2.4.0.8089")
$Error = 1
EndIf
WEnd
Next
If $Error == 0 Then
TrayTip("RG WoW Installer", "Patch was downloaded to your WoW Dir.", 5, 1)
MsgBox(-1, "Succes", "Download Complete!!! -" & $wowpath, 3)
logfile("Patch 2.4 - Deutsch (2.3.3.7799 -> 2.4.0.8089) : DL succesfull")
TrayTip("RG WoW Installer", "Patch wird entpackt und gestartet, bitte haben Sie Geduld", 5, 1)
#RequireAdmin
_zip_unzipall($wowpath & "Patch 2.4 - Deutsch.zip", $wowpath & "Patch 2.4 - Deutsch", 0)
$exe = _FileListToArray($wowpath & "Patch 2.4 - Deutsch\", "*.exe")
Run($wowpath & "Patch 2.4 - Deutsch\" & $exe[1])
WinWait("100% - Blizzard Updater", "Patchvorgang war erfolgreich.")
ControlClick("100% - Blizzard Updater", "&OK", "Button1")
Sleep(2000)
If ProcessExists("launcher.exe") Then ProcessClose("launcher.exe")
$versionlocal = FileGetVersion($wowpath & "\WoW.exe")
if ende() = true then ; ABFRAGE HIER
msgbox(0,"","ende")
else
Patchstatus()
EndIf ; ENDE DER ABFRAGE
Endif
$Error = 0
EndIf
EndFunc ;==>Patch1
Er hört auf jeden Fall auf zu patchen, das heißt er erkennt das die versionen gleich sind. gibt mir aber keine rückgabe raus, also keine msgbox(0,"",fertig")
dsw denk ich irgendwas stimmt nicht.
if ende() = true then ; ABFRAGE HIER
msgbox(0,"","ende")
else
Patchstatus()
EndIf ; ENDE DER ABFRAGE
Endif
wird hier die ende func überhaupt aufgerufen?
Gruß
Kev