PHP Code:
#cs ################################################################################################
Copyright Source by: Freaky
Copyright Picture by: PixeL
Lizenz:
Sie dürfen die Source so anpassen wie es ihnen past.
Das Copyright darf nicht aus den Bildern entfernt werden.
Es dürfen nur die Bilder ausgetauscht werden die kein Copyright besitzen
Die Bilder dürfen bearbeitet werden solange das Copyright bleibt.
Der Patcher darf in veränderter Form veröffentlicht werden solange das Copyright da ist.
#ce ################################################################################################
#NoTrayIcon
#RequireAdmin
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <SendMessage.au3>
#include <StaticConstants.au3>
#include <String.au3>
#include <WindowsConstants.au3>
#include <GDIpProgress.au3>
TCPStartup ()
Global $pIcon = ".\icon", $buttons[7][3], $version = "1"
Global $titel = "Instinct-Network Starter" ; Titel des Patchers
Global $pName = "SelfPatcher.exe"; SelfPatcher Name
Global $pUrl = "http://instinct-network.de" ; Hier kommt die Domain zum Patch Server z.B. http://www.google.de NICHT MEHR
Global $click = 0
If ProcessExists($pName) Then ProcessClose($pName)
If FileExists($pName) Then FileDelete($pName)
If TCPConnect (TCPNameToIP ($pUrl),80) = 0 Then
MsgBox(0, "Fehler", "Patch Server nicht erreichbar")
TCPShutdown ()
Exit
Else
TCPShutdown()
$pUrl &= "/patcher/" ; Link zum Pfad wo die ganzen Datein zum Patchen liegen die nach der Domain kommen. s.o.: Patcher.exe, Pack ordner etc.
EndIf
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate($titel, 606, 237, Default, Default, $WS_POPUP)
$buttons[1][0] = GUICtrlCreatePic($pIcon & "\start0.jpg", 360, 184, 111, 19)
$buttons[1][1] = "start"
$buttons[2][0] = GUICtrlCreatePic($pIcon & "\beenden0.jpg", 474, 184, 111, 19)
$buttons[2][1] = "beenden"
$buttons[3][0] = GUICtrlCreatePic($pIcon & "\hp0.jpg", 360, 205, 111, 19)
$buttons[3][1] = "hp"
$buttons[4][0] = GUICtrlCreatePic($pIcon & "\forum0.jpg", 474, 205, 111, 19)
$buttons[4][1] = "forum"
$buttons[5][0] = GUICtrlCreatePic($pIcon & "\x0.jpg", 574, 4, 16, 15)
$buttons[5][1] = "x"
$buttons[6][0] = GUICtrlCreatePic($pIcon & "\_0.jpg", 556, 4, 16, 15)
$buttons[6][1] = "_"
Dim $cNews[4]
For $i = 0 To 3
$cNews[$i] = GUICtrlCreatePic($pIcon & "\pixel.jpg", 97, 43 + (($i) * 30), 176, 17, $BS_BITMAP)
Next
$Edit1 = GUICtrlCreateEdit("", 363, 38, 219, 124, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_READONLY), $ES_READONLY)
GUICtrlSetColor(-1, 0xcccccc)
GUICtrlSetBkColor(-1, 0x151515)
$titel_leiste = GUICtrlCreatePic($pIcon & "\head.jpg", 0, 0, 606, 24, BitOR($SS_NOTIFY, $WS_CLIPSIBLINGS))
$Pic1 = GUICtrlCreatePic($pIcon & "\bg.jpg", 0, 0, 606, 237, BitOR($SS_NOTIFY, $WS_CLIPSIBLINGS))
;~ $titel_text = GUICtrlCreateLabel($titel, 13, 5, 500, 22)
;~ GUICtrlSetColor(-1, 0xFFFFFF)
;~ GUICtrlSetFont(-1, 10, 800, 0, "Arial")
;~ GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$read = BinaryToString(InetRead($pUrl & "data.xml"))
Global $data = _StringBetween($read, "<data>", "</data>")
If IsArray($data) Then
For $i = 0 To 3
$bild = _StringBetween($data[$i], '<bild="', '">')
$text = _StringBetween($data[$i], '<text="', '">')
$datum = _StringBetween($data[$i], '<datum="', '">')
$farbe = _StringBetween($data[$i], '<farbe="', '">')
GUICtrlCreatePic("icon\" & $bild[0] & ".jpg", 32, 44 + (($i) * 30), 52, 16)
GUICtrlCreateLabel($text[0], 97, 43 + (($i) * 30), 176, 17)
GUICtrlSetColor(-1, $farbe[0])
GUICtrlSetFont(-1, 10, 400, 0, "Candara")
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel($datum[0], 271, 44 + (($i) * 30), 58, 17)
GUICtrlSetFont(-1, 8, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
Next
EndIf
;~ $Progress1 = GUICtrlCreateProgress (20, 186, 292, 14)
;~ $Progress2 = GUICtrlCreateProgress (20, 207, 292, 14)
$Progress1 = _ProgressCreate(20, 186, 292, 14)
_ProgressSetColors($Progress1, 0x09B8F8, 0x09B8F8, 0xFFFFFF, 0xFFFFFF); 0x0F8CB3, 0x0F8CB3)
_ProgressSetText($Progress1, " ")
$Progress2 = _ProgressCreate(20, 207, 292, 14)
_ProgressSetColors($Progress2, 0xefff12, 0xefff12, 0xFFFFFF, 0xFFFFFF); 0xc4d110, 0xc4d110)
_ProgressSetText($Progress2, " ")
$Label1 = GUICtrlCreateLabel("0%", 316, 187, 30, 14)
GUICtrlSetFont(-1, 8)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label2 = GUICtrlCreateLabel("0%", 316, 208, 30, 14)
GUICtrlSetFont(-1, 8)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
_sleep(100)
WEnd
Func _GUI_hover()
Local $iMouse = GUIGetCursorInfo($Form1)
If Not @error Then
For $i = 0 To UBound($buttons) - 1
If $iMouse[4] = $buttons[$i][0] Then
If $iMouse[2] And $buttons[$i][2] <> 1 Then
GUICtrlSetImage($buttons[$i][0], $pIcon & "\" & $buttons[$i][1] & "2.jpg")
$buttons[$i][2] = 1
ElseIf Not $iMouse[2] And $buttons[$i][2] <> 2 Then
GUICtrlSetImage($buttons[$i][0], $pIcon & "\" & $buttons[$i][1] & "1.jpg")
$buttons[$i][2] = 2
EndIf
ElseIf $iMouse[4] <> $buttons[$i][0] And $buttons[$i][2] <> 0 Then
GUICtrlSetImage($buttons[$i][0], $pIcon & "\" & $buttons[$i][1] & "0.jpg")
$buttons[$i][2] = 0
EndIf
Next
EndIf
EndFunc ;==>_GUI_hover
Func _buttons()
$nMsg = GUIGetMsg()
Switch $nMsg
Case $buttons[1][0]
$click += 1
If $click = 1 Then
$inet = BinaryToString(InetRead($pUrl & "index.php")); Hier kommt der Name der config Datei rein für die Größe und der Datei
$iString = StringSplit($inet, "<br>", 1)
For $l = 1 To UBound($iString) - 1
If $iString[$l] <> "" Then
$iString2 = StringSplit($iString[$l], "=", 1)
;_ArrayDisplay ($iString)
If StringInStr($iString2[1], "/") Then
$eintragen = StringSplit($iString2[1], "/")
$eintragen = $eintragen[2]
Else
$eintragen = $iString2[1]
EndIf
If $eintragen <> "" Then
If $iString2[2] <> FileGetSize(@ScriptDir & "\" & $iString2[1]) Then
GUICtrlSetData($Edit1, $eintragen & " wird aktualisiert" & @CRLF & GUICtrlRead($Edit1))
If StringInStr($iString2[1], "/") Then
$iDir = StringSplit($iString2[1], "/")
If Not FileExists(@ScriptDir & "\" & $iDir[1]) Then DirCreate(@ScriptDir & "\" & $iDir[1])
EndIf
$iString2[1] = StringReplace($iString2[1], "/", "\")
;FileDelete (@ScriptDir & "\" & $iString[$i])
$iGet = InetGet($pUrl & $iString2[1], @ScriptDir & "\" & $iString2[1], 1, 1)
$prozent = ""
While InetGetInfo($iGet, 2) = False
$prozent = Round(InetGetInfo($iGet, 0) / InetGetInfo($iGet, 1) * 100, 1)
If GUICtrlRead($Label1) <> $prozent & "%" Then __ProgressSet($Progress1, $prozent, $Label1)
_sleep(100)
WEnd
__ProgressSet($Progress1, 100, $Label1)
GUICtrlSetData($Edit1, $eintragen & " ist fertig geladen." & @CRLF & GUICtrlRead($Edit1))
Else
GUICtrlSetData($Edit1, $eintragen & " ist aktuell." & @CRLF & GUICtrlRead($Edit1))
EndIf
;GUICtrlSetData($Progress2, Round($i / UBound($Config) * 100, 2))
$prozent2 = Round($l / (UBound($iString) - 1) * 100, 1)
If GUICtrlRead($Label2) <> $prozent2 & "%" Then __ProgressSet($Progress2, $prozent2, $Label2)
_buttons()
EndIf
EndIf
Next
GUICtrlSetData($Edit1, "Update wurde beendet." & @CRLF & GUICtrlRead($Edit1))
__ProgressSet($Progress2, 100, $Label2)
$click = 0
ElseIf $click = 3 Then
EndIf
Case $GUI_EVENT_CLOSE
Exit
Case $buttons[2][0]
Exit
Case $buttons[3][0]
ShellExecute("http://instinct-network.de/") ; Link zur Homepage
Case $buttons[4][0]
ShellExecute("http://instinct-network.de/board/") ; Link zum Forum
Case $buttons[5][0]
Exit
Case $buttons[6][0]
GUISetState(@SW_MINIMIZE, $Form1)
Case $titel_leiste
_SendMessage($Form1, $WM_SYSCOMMAND, 0xF012, 0)
EndSwitch
_GUI_hover()
EndFunc ;==>_buttons
Func __ProgressSet($Progress, $prozent, $label)
_ProgressSet($Progress, $prozent)
GUICtrlSetData($label, $prozent & "%")
EndFunc ;==>__ProgressSet
Func _sleep($zeit)
Local $timer = TimerInit()
_buttons()
Do
_buttons()
Until TimerDiff($timer) >= $zeit
EndFunc ;==>_sleep
Hallo, das ist mein Source, und ich weiß nicht wie man das einbauen kann, das nach den Patchen, eine exe startet...
Kann mir jemand weiter helfen?