InetFileExists ?

  • ich wollte mal Fragen ob es das gibt, weil ich habe einen Updater für ein game gemacht der Updater Funzt meines Wissens einwandfrei und hatt eig. auch keine bugs
    mein Problem ist wenn hinter der angegebenen URL (hinter der die UpdateVersion.txt hinterlegt ist) nichts ist bzw. die URL nicht erreichbar ist startet er die UpdateFunktion weil er nichts zum Vergleichen hatt daher wollte ich fragen ob ich irgendwie vorher prüfen kann ob die url erreichbar ist und ob die datei hinter der url liegt

    ich gebe mal mein script mit dazu

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ComboConstants.au3>
    #include <ListViewConstants.au3>
    #include <StaticConstants.au3>
    #include <ButtonConstants.au3>
    #include <ListBoxConstants.au3>
    #include <TabConstants.au3>
    #include <EditConstants.au3>
    #include <DateTimeConstants.au3>
    #include <SliderConstants.au3>
    #include <TreeViewConstants.au3>
    #include <ProgressConstants.au3>
    #include <AVIConstants.au3>
    #include <UpDownConstants.au3>
    #include<Array.au3>
    #include<File.au3>
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $IpRead = FileReadLine("Launcher.txt", 6)
    If FileExists("C:\UpdateVersion.txt") Then
    _Funce ()
    Else
    FileWrite("C:\UpdateVersion.txt", "1234567gdertfderdvbhtt")
    Sleep(1000)
    _Funce ()
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Func _Funce ()
    $Ip2 = ($IpRead)
    $ver = FileRead("C:\UpdateVersion.txt")
    InetGet($Ip2 &"/UpdateVersion.txt",@ScriptDir &"\UpdateVersion.txt")
    $file = FileOpen(@ScriptDir & "\UpdateVersion.txt", 0)
    $line = FileRead($file)
    If $line = $ver Then
    FileClose($file)
    Else
    FileClose($file)
    Sleep(500)
    FileDelete("C:\UpdateVersion.txt")
    Sleep(1000)
    FileCopy(@ScriptDir & "\UpdateVersion.txt", "C:\UpdateVersion.txt")
    ProgressOn("Checking Resource", "Checking Resource")
    Sleep(1000)
    ProgressSet(20, "Checking Resource", "20 %")
    Sleep(1000)
    ProgressSet(50, "Checking Resource", "50 %")
    Sleep(1000)
    ProgressSet(100, "Checking Resource", "100 %")
    Sleep(500)
    ProgressOff()
    _Func ()
    EndIf
    EndFunc
    Func _Func ()
    $IpRead = FileReadLine("Launcher.txt", 6)
    $Ip = ($IpRead)
    Local $meinarray
    InetGet($Ip &"/file.list",@ScriptDir &"\file.list")
    $filename = (@ScriptDir &"\file.list")
    $FILEPATH = (@ScriptDir &"\file.txt")
    $hFile = FileOpen($filename,0)
    _FilereadToArray($filename, $meinarray)
    _FileWriteFromArray($FILEPATH, $meinarray)
    $split = StringRegExp(FileRead(FileOpen(@ScriptDir & '\file.txt', 0)), '(?<=\n|\A).*(?=,)', 3)
    $file = FileOpen("UpdInf.txt",2)
    For $i = 0 To Ubound($split) -1
    FileWrite("UpdInf.txt", $split[$i] & @crlf)
    Next
    $filename1 = @ScriptDir & '\UpdInf.txt'
    $filename2 = @ScriptDir & '\UpdInf2.txt'
    Local $meinarray1
    Local $nLfd
    _FileReadToArray($filename1,$meinarray1)
    For $nLfd = 1 To $meinarray1[0]
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\\','\/')
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\./','/')
    Next
    _FileWriteFromArray($filename1,$meinarray1,1,$meinarray1[0])
    $filename1 = @ScriptDir & '\UpdInf.txt'
    $filename2 = @ScriptDir & '\UpdInf2.txt'
    Local $meinarray1
    Local $nLfd
    _FileReadToArray($filename1,$meinarray1)
    For $nLfd = 1 To $meinarray1[0]
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\/','\\')
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\.\','\\')
    Next
    _FileWriteFromArray($filename2,$meinarray1,1,$meinarray1[0])
    ProgressOn("Updating KalOnline", "KalOnline-Update in Progress", "Update")
    $filename0 = FileOpen("UpdInf.txt",0)
    $filename3 = FileOpen("UpdInf2.txt",0)
    ProgressSet(0,"0%")
    Local $der
    $der = FileReadLine("file.txt", 1)
    for $i = 1 to $der
    $1 = FileReadLine($filename0,$i)
    $2 = FileReadLine($filename3,$i)
    Inetget($Ip&$1,@ScriptDir &$2)
    If $i = 1 Then ProgressSet(5,"5 %")
    If $i = $der/10 Then ProgressSet(10,"10 %")
    If $i = $der/8 Then ProgressSet(40,"40 %")
    If $i = $der/6 Then ProgressSet(50,"50 %")
    If $i = $der/5 Then ProgressSet(60,"60 %")
    If $i = $der/4 Then ProgressSet(70,"70 %")
    If $i = $der/3 Then ProgressSet(80,"80 %")
    If $i = $der/2 Then ProgressSet(90,"90 %")
    If $i = $der Then ProgressSet(95,"95 %")
    Next
    ProgressSet(100,"100 %")
    Sleep(200)
    ProgressOff()
    FileClose(@ScriptDir &"UpdInf.txt")
    FileClose(@ScriptDir &"UpdInf2.txt")
    FileClose(@ScriptDir &"file.list")
    FileClose(@ScriptDir &"file.txt")
    FileDelete(@ScriptDir &"UpdInf.txt")
    FileDelete(@ScriptDir &"UpdInf2.txt")
    FileDelete(@ScriptDir &"file.list")
    FileDelete(@ScriptDir &"file.txt")
    MsgBox(0,"Updates", "All Updates Finished", 1)
    MsgBox(0,"Updates", "All Updates Finished", 1)
    EndFunc
    FileInstall("Launcherback.jpg",@TempDir & "\Launcherback.jpg")
    $HTT = FileReadLine("Launcher.txt",4)
    $Lname = FileReadLine("Launcher.txt",2)
    $LaName = FileReadLine("Launcher.txt",2)
    $notice = FileRead("notice.txt")
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate($Lname, 297, 400, -1, -1, $ws_popup)
    $Pic1 = GUICtrlCreatePic(@TempDir & "\Launcherback.jpg", 0, 0, 297, 400, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS,$WS_DISABLED))
    $Close = GUICtrlCreateButton("X", 282, 0, 16, 16, 0)
    $Start = GUICtrlCreateButton("Start Game", 8, 376, 70, 20, 0)
    $Set = GUICtrlCreateButton("Settings", 112, 376, 70, 20, 0)
    $WEB = GUICtrlCreateButton("Website", 216, 376, 70, 20, 0)
    $Edit1 = GUICtrlCreateEdit("", 0, 264, 297, 105)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xffffff)
    GUICtrlSetData(-1, $notice)
    $Label1 = GUICtrlCreateLabel($LaName &" Launcher", 80, 0, 145, 17)
    GUICtrlSetFont(-1, 10, 800, 2, "Narkisim")
    GUICtrlSetColor(-1, 0x008000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Close
    _Close ()
    Case $Start
    _Start ()
    Case $WEB
    _WEB ()
    Case $Set
    _Set ()
    EndSwitch
    WEnd
    Func _Start ()
    ShellExecute("engine.exe","/load /config debug")
    Endfunc
    Func _WEB ()
    ShellExecute($HTT)
    EndFunc
    Func _Set ()
    FileInstall("Reso.exe","Reso.exe")
    MsgBox(0, "Setting", "Here you can change the Game Resolution, other settings please change in Game",4)
    Sleep(500)
    Run("Reso.exe")
    Exit
    EndFunc
    Func _Close ()
    Exit
    Endfunc

    [/autoit]


    und hoffe das so etwas realisierbar wäre

    Mfg Eistee

  • [autoit]

    $file = InetGetSize("http://keineahnung.de/test.exe")
    If $file = 0 Then
    MsgBox(0, "Error", "Diese Datei existiert nicht")
    ElseIf $file > 0 Then
    MsgBox(0, "Success", "Die Datei existiert und ist "&$file&" Bytes groß")
    EndIf

    [/autoit]

    So?

    MFG FireFlyer

    *Paradox ist, wenn man sich im Handumdrehen den Fuss bricht* :D

  • Spoiler anzeigen
    [autoit]

    While 1
    $file = InetGetSize("http://keineahnung.de/test.exe")
    If $file = 0 Then
    MsgBox(0, "Error", "Diese Datei existiert nicht")
    ExitLoop
    ElseIf $file > 0 Then
    MsgBox(0, "Success", "Die Datei existiert und ist "&$file&" Bytes groß")
    EndIf
    ;blablabla das was er machen soll wenn die datei existiert
    WEnd
    ;hier gehts weiter wenn die datei nicht existiert ;)
    ;ODER!!!
    Func _inetfileexists()
    $file = InetGetSize("http://keineahnung.de/test.exe")
    If $file = 0 Then
    MsgBox(0, "Error", "Diese Datei existiert nicht")
    Return(0)
    ElseIf $file > 0 Then
    MsgBox(0, "Success", "Die Datei existiert und ist "&$file&" Bytes groß")
    EndIf
    ;blablabla das was er machen soll wenn die datei existiert
    EndFunc

    [/autoit]

    MFG FireFlyer

    *Paradox ist, wenn man sich im Handumdrehen den Fuss bricht* :D

  • Da komme ich jetzt nicht ganz mit
    Ich weis ja wie ich meinem script sage was es tun soll wenn etwas zutrifft oder nicht
    aber das was er ausführen soll wenn die datei nicht existiert kann ich nicht in eine Func machen

    wenn die datei nicht existiert soll er in der komentierten zeile weitermachen

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ComboConstants.au3>
    #include <ListViewConstants.au3>
    #include <StaticConstants.au3>
    #include <ButtonConstants.au3>
    #include <ListBoxConstants.au3>
    #include <TabConstants.au3>
    #include <EditConstants.au3>
    #include <DateTimeConstants.au3>
    #include <SliderConstants.au3>
    #include <TreeViewConstants.au3>
    #include <ProgressConstants.au3>
    #include <AVIConstants.au3>
    #include <UpDownConstants.au3>
    #include<Array.au3>
    #include<File.au3>
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    $file = InetGetSize("http://keineahnung.de/test.exe")
    If $file = 0 Then
    ElseIf $file > 0 Then
    _1 ()
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _1 ()
    $IpRead = FileReadLine("Launcher.txt", 6)
    If FileExists("C:\UpdateVersion.txt") Then
    _Funce ()
    Else
    FileWrite("C:\UpdateVersion.txt", "1234567gdertfderdvbhtt")
    Sleep(1000)
    _Funce ()
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Funce ()
    $Ip2 = ($IpRead)
    $ver = FileRead("C:\UpdateVersion.txt")
    InetGet($Ip2 &"/UpdateVersion.txt",@ScriptDir &"\UpdateVersion.txt")
    $file = FileOpen(@ScriptDir & "\UpdateVersion.txt", 0)
    $line = FileRead($file)
    If $line = $ver Then
    FileClose($file)
    Else
    FileClose($file)
    Sleep(500)
    FileDelete("C:\UpdateVersion.txt")
    Sleep(1000)
    FileCopy(@ScriptDir & "\UpdateVersion.txt", "C:\UpdateVersion.txt")
    ProgressOn("Checking Resource", "Checking Resource")
    Sleep(1000)
    ProgressSet(20, "Checking Resource", "20 %")
    Sleep(1000)
    ProgressSet(50, "Checking Resource", "50 %")
    Sleep(1000)
    ProgressSet(100, "Checking Resource", "100 %")
    Sleep(500)
    ProgressOff()
    _Func ()
    EndIf
    EndFunc
    Func _Func ()
    $IpRead = FileReadLine("Launcher.txt", 6)
    $Ip = ($IpRead)
    Local $meinarray
    InetGet($Ip &"/file.list",@ScriptDir &"\file.list")
    $filename = (@ScriptDir &"\file.list")
    $FILEPATH = (@ScriptDir &"\file.txt")
    $hFile = FileOpen($filename,0)
    _FilereadToArray($filename, $meinarray)
    _FileWriteFromArray($FILEPATH, $meinarray)
    $split = StringRegExp(FileRead(FileOpen(@ScriptDir & '\file.txt', 0)), '(?<=\n|\A).*(?=,)', 3)
    $file = FileOpen("UpdInf.txt",2)
    For $i = 0 To Ubound($split) -1
    FileWrite("UpdInf.txt", $split[$i] & @crlf)
    Next
    $filename1 = @ScriptDir & '\UpdInf.txt'
    $filename2 = @ScriptDir & '\UpdInf2.txt'
    Local $meinarray1
    Local $nLfd
    _FileReadToArray($filename1,$meinarray1)
    For $nLfd = 1 To $meinarray1[0]
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\\','\/')
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\./','/')
    Next
    _FileWriteFromArray($filename1,$meinarray1,1,$meinarray1[0])
    $filename1 = @ScriptDir & '\UpdInf.txt'
    $filename2 = @ScriptDir & '\UpdInf2.txt'
    Local $meinarray1
    Local $nLfd
    _FileReadToArray($filename1,$meinarray1)
    For $nLfd = 1 To $meinarray1[0]
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\/','\\')
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\.\','\\')
    Next
    _FileWriteFromArray($filename2,$meinarray1,1,$meinarray1[0])
    ProgressOn("Updating KalOnline", "KalOnline-Update in Progress", "Update")
    $filename0 = FileOpen("UpdInf.txt",0)
    $filename3 = FileOpen("UpdInf2.txt",0)
    ProgressSet(0,"0%")
    Local $der
    $der = FileReadLine("file.txt", 1)
    for $i = 1 to $der
    $1 = FileReadLine($filename0,$i)
    $2 = FileReadLine($filename3,$i)
    Inetget($Ip&$1,@ScriptDir &$2)
    If $i = 1 Then ProgressSet(5,"5 %")
    If $i = $der/10 Then ProgressSet(10,"10 %")
    If $i = $der/8 Then ProgressSet(40,"40 %")
    If $i = $der/6 Then ProgressSet(50,"50 %")
    If $i = $der/5 Then ProgressSet(60,"60 %")
    If $i = $der/4 Then ProgressSet(70,"70 %")
    If $i = $der/3 Then ProgressSet(80,"80 %")
    If $i = $der/2 Then ProgressSet(90,"90 %")
    If $i = $der Then ProgressSet(95,"95 %")
    Next
    ProgressSet(100,"100 %")
    Sleep(200)
    ProgressOff()
    FileClose(@ScriptDir &"UpdInf.txt")
    FileClose(@ScriptDir &"UpdInf2.txt")
    FileClose(@ScriptDir &"file.list")
    FileClose(@ScriptDir &"file.txt")
    FileDelete(@ScriptDir &"UpdInf.txt")
    FileDelete(@ScriptDir &"UpdInf2.txt")
    FileDelete(@ScriptDir &"file.list")
    FileDelete(@ScriptDir &"file.txt")
    MsgBox(0,"Updates", "All Updates Finished", 1)
    MsgBox(0,"Updates", "All Updates Finished", 1)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    FileInstall("Launcherback.jpg",@TempDir & "\Launcherback.jpg"); ab hier solls weitergehen wenn sie nicht existiert
    $HTT = FileReadLine("Launcher.txt",4)
    $Lname = FileReadLine("Launcher.txt",2)
    $LaName = FileReadLine("Launcher.txt",2)
    $notice = FileRead("notice.txt")$Form1 = GUICreate($Lname, 297, 400, -1, -1, $ws_popup)
    $Pic1 = GUICtrlCreatePic(@TempDir & "\Launcherback.jpg", 0, 0, 297, 400, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS,$WS_DISABLED))
    $Close = GUICtrlCreateButton("X", 282, 0, 16, 16, 0)
    $Start = GUICtrlCreateButton("Start Game", 8, 376, 70, 20, 0)
    $Set = GUICtrlCreateButton("Settings", 112, 376, 70, 20, 0)
    $WEB = GUICtrlCreateButton("Website", 216, 376, 70, 20, 0)
    $Edit1 = GUICtrlCreateEdit("", 0, 264, 297, 105)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xffffff)
    GUICtrlSetData(-1, $notice)
    $Label1 = GUICtrlCreateLabel($LaName &" Launcher", 80, 0, 145, 17)
    GUICtrlSetFont(-1, 10, 800, 2, "Narkisim")
    GUICtrlSetColor(-1, 0x008000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Close
    _Close ()
    Case $Start
    _Start ()
    Case $WEB
    _WEB ()
    Case $Set
    _Set ()
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Start ()
    ShellExecute("engine.exe","/load /config debug")
    Endfunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _WEB ()
    ShellExecute($HTT)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Set ()
    FileInstall("Reso.exe","Reso.exe")
    MsgBox(0, "Setting", "Here you can change the Game Resolution, other settings please change in Game",4)
    Sleep(500)
    Run("Reso.exe")
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Close ()
    Exit
    Endfunc

    [/autoit]
  • Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ComboConstants.au3>
    #include <ListViewConstants.au3>
    #include <StaticConstants.au3>
    #include <ButtonConstants.au3>
    #include <ListBoxConstants.au3>
    #include <TabConstants.au3>
    #include <EditConstants.au3>
    #include <DateTimeConstants.au3>
    #include <SliderConstants.au3>
    #include <TreeViewConstants.au3>
    #include <ProgressConstants.au3>
    #include <AVIConstants.au3>
    #include <UpDownConstants.au3>
    #include<Array.au3>
    #include<File.au3>
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    $file = InetGetSize("http://keineahnung.de/test.exe")
    If $file > 0 Then
    _1 ()
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _1 ()
    $IpRead = FileReadLine("Launcher.txt", 6)
    If FileExists("C:\UpdateVersion.txt") Then
    _Funce ()
    Else
    FileWrite("C:\UpdateVersion.txt", "1234567gdertfderdvbhtt")
    Sleep(1000)
    _Funce ()
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Funce ()
    $Ip2 = ($IpRead)
    $ver = FileRead("C:\UpdateVersion.txt")
    InetGet($Ip2 &"/UpdateVersion.txt",@ScriptDir &"\UpdateVersion.txt")
    $file = FileOpen(@ScriptDir & "\UpdateVersion.txt", 0)
    $line = FileRead($file)
    If $line = $ver Then
    FileClose($file)
    Else
    FileClose($file)
    Sleep(500)
    FileDelete("C:\UpdateVersion.txt")
    Sleep(1000)
    FileCopy(@ScriptDir & "\UpdateVersion.txt", "C:\UpdateVersion.txt")
    ProgressOn("Checking Resource", "Checking Resource")
    Sleep(1000)
    ProgressSet(20, "Checking Resource", "20 %")
    Sleep(1000)
    ProgressSet(50, "Checking Resource", "50 %")
    Sleep(1000)
    ProgressSet(100, "Checking Resource", "100 %")
    Sleep(500)
    ProgressOff()
    _Func ()
    EndIf
    EndFunc
    Func _Func ()
    $IpRead = FileReadLine("Launcher.txt", 6)
    $Ip = ($IpRead)
    Local $meinarray
    InetGet($Ip &"/file.list",@ScriptDir &"\file.list")
    $filename = (@ScriptDir &"\file.list")
    $FILEPATH = (@ScriptDir &"\file.txt")
    $hFile = FileOpen($filename,0)
    _FilereadToArray($filename, $meinarray)
    _FileWriteFromArray($FILEPATH, $meinarray)
    $split = StringRegExp(FileRead(FileOpen(@ScriptDir & '\file.txt', 0)), '(?<=\n|\A).*(?=,)', 3)
    $file = FileOpen("UpdInf.txt",2)
    For $i = 0 To Ubound($split) -1
    FileWrite("UpdInf.txt", $split[$i] & @crlf)
    Next
    $filename1 = @ScriptDir & '\UpdInf.txt'
    $filename2 = @ScriptDir & '\UpdInf2.txt'
    Local $meinarray1
    Local $nLfd
    _FileReadToArray($filename1,$meinarray1)
    For $nLfd = 1 To $meinarray1[0]
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\\','\/')
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\./','/')
    Next
    _FileWriteFromArray($filename1,$meinarray1,1,$meinarray1[0])
    $filename1 = @ScriptDir & '\UpdInf.txt'
    $filename2 = @ScriptDir & '\UpdInf2.txt'
    Local $meinarray1
    Local $nLfd
    _FileReadToArray($filename1,$meinarray1)
    For $nLfd = 1 To $meinarray1[0]
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\/','\\')
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\.\','\\')
    Next
    _FileWriteFromArray($filename2,$meinarray1,1,$meinarray1[0])
    ProgressOn("Updating KalOnline", "KalOnline-Update in Progress", "Update")
    $filename0 = FileOpen("UpdInf.txt",0)
    $filename3 = FileOpen("UpdInf2.txt",0)
    ProgressSet(0,"0%")
    Local $der
    $der = FileReadLine("file.txt", 1)
    for $i = 1 to $der
    $1 = FileReadLine($filename0,$i)
    $2 = FileReadLine($filename3,$i)
    Inetget($Ip&$1,@ScriptDir &$2)
    If $i = 1 Then ProgressSet(5,"5 %")
    If $i = $der/10 Then ProgressSet(10,"10 %")
    If $i = $der/8 Then ProgressSet(40,"40 %")
    If $i = $der/6 Then ProgressSet(50,"50 %")
    If $i = $der/5 Then ProgressSet(60,"60 %")
    If $i = $der/4 Then ProgressSet(70,"70 %")
    If $i = $der/3 Then ProgressSet(80,"80 %")
    If $i = $der/2 Then ProgressSet(90,"90 %")
    If $i = $der Then ProgressSet(95,"95 %")
    Next
    ProgressSet(100,"100 %")
    Sleep(200)
    ProgressOff()
    FileClose(@ScriptDir &"UpdInf.txt")
    FileClose(@ScriptDir &"UpdInf2.txt")
    FileClose(@ScriptDir &"file.list")
    FileClose(@ScriptDir &"file.txt")
    FileDelete(@ScriptDir &"UpdInf.txt")
    FileDelete(@ScriptDir &"UpdInf2.txt")
    FileDelete(@ScriptDir &"file.list")
    FileDelete(@ScriptDir &"file.txt")
    MsgBox(0,"Updates", "All Updates Finished", 1)
    MsgBox(0,"Updates", "All Updates Finished", 1)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    FileInstall("Launcherback.jpg",@TempDir & "\Launcherback.jpg"); ab hier solls weitergehen wenn sie nicht existiert
    $HTT = FileReadLine("Launcher.txt",4)
    $Lname = FileReadLine("Launcher.txt",2)
    $LaName = FileReadLine("Launcher.txt",2)
    $notice = FileRead("notice.txt")$Form1 = GUICreate($Lname, 297, 400, -1, -1, $ws_popup)
    $Pic1 = GUICtrlCreatePic(@TempDir & "\Launcherback.jpg", 0, 0, 297, 400, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS,$WS_DISABLED))
    $Close = GUICtrlCreateButton("X", 282, 0, 16, 16, 0)
    $Start = GUICtrlCreateButton("Start Game", 8, 376, 70, 20, 0)
    $Set = GUICtrlCreateButton("Settings", 112, 376, 70, 20, 0)
    $WEB = GUICtrlCreateButton("Website", 216, 376, 70, 20, 0)
    $Edit1 = GUICtrlCreateEdit("", 0, 264, 297, 105)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xffffff)
    GUICtrlSetData(-1, $notice)
    $Label1 = GUICtrlCreateLabel($LaName &" Launcher", 80, 0, 145, 17)
    GUICtrlSetFont(-1, 10, 800, 2, "Narkisim")
    GUICtrlSetColor(-1, 0x008000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Close
    _Close ()
    Case $Start
    _Start ()
    Case $WEB
    _WEB ()
    Case $Set
    _Set ()
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Start ()
    ShellExecute("engine.exe","/load /config debug")
    Endfunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _WEB ()
    ShellExecute($HTT)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Set ()
    FileInstall("Reso.exe","Reso.exe")
    MsgBox(0, "Setting", "Here you can change the Game Resolution, other settings please change in Game",4)
    Sleep(500)
    Run("Reso.exe")
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Close ()
    Exit
    Endfunc

    [/autoit]

    So? Bzw: zur besseren übersicht sollte man Funktionen vom rest trennnen ;)

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ComboConstants.au3>
    #include <ListViewConstants.au3>
    #include <StaticConstants.au3>
    #include <ButtonConstants.au3>
    #include <ListBoxConstants.au3>
    #include <TabConstants.au3>
    #include <EditConstants.au3>
    #include <DateTimeConstants.au3>
    #include <SliderConstants.au3>
    #include <TreeViewConstants.au3>
    #include <ProgressConstants.au3>
    #include <AVIConstants.au3>
    #include <UpDownConstants.au3>
    #include<Array.au3>
    #include<File.au3>
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    $file = InetGetSize("http://keineahnung.de/test.exe")
    If $file > 0 Then
    _1 ()
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    FileInstall("Launcherback.jpg",@TempDir & "\Launcherback.jpg"); ab hier solls weitergehen wenn sie nicht existiert
    $HTT = FileReadLine("Launcher.txt",4)
    $Lname = FileReadLine("Launcher.txt",2)
    $LaName = FileReadLine("Launcher.txt",2)
    $notice = FileRead("notice.txt")$Form1 = GUICreate($Lname, 297, 400, -1, -1, $ws_popup)
    $Pic1 = GUICtrlCreatePic(@TempDir & "\Launcherback.jpg", 0, 0, 297, 400, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS,$WS_DISABLED))
    $Close = GUICtrlCreateButton("X", 282, 0, 16, 16, 0)
    $Start = GUICtrlCreateButton("Start Game", 8, 376, 70, 20, 0)
    $Set = GUICtrlCreateButton("Settings", 112, 376, 70, 20, 0)
    $WEB = GUICtrlCreateButton("Website", 216, 376, 70, 20, 0)
    $Edit1 = GUICtrlCreateEdit("", 0, 264, 297, 105)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xffffff)
    GUICtrlSetData(-1, $notice)
    $Label1 = GUICtrlCreateLabel($LaName &" Launcher", 80, 0, 145, 17)
    GUICtrlSetFont(-1, 10, 800, 2, "Narkisim")
    GUICtrlSetColor(-1, 0x008000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Close
    _Close ()
    Case $Start
    _Start ()
    Case $WEB
    _WEB ()
    Case $Set
    _Set ()
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _1 ()
    $IpRead = FileReadLine("Launcher.txt", 6)
    If FileExists("C:\UpdateVersion.txt") Then
    _Funce ()
    Else
    FileWrite("C:\UpdateVersion.txt", "1234567gdertfderdvbhtt")
    Sleep(1000)
    _Funce ()
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Funce ()
    $Ip2 = ($IpRead)
    $ver = FileRead("C:\UpdateVersion.txt")
    InetGet($Ip2 &"/UpdateVersion.txt",@ScriptDir &"\UpdateVersion.txt")
    $file = FileOpen(@ScriptDir & "\UpdateVersion.txt", 0)
    $line = FileRead($file)
    If $line = $ver Then
    FileClose($file)
    Else
    FileClose($file)
    Sleep(500)
    FileDelete("C:\UpdateVersion.txt")
    Sleep(1000)
    FileCopy(@ScriptDir & "\UpdateVersion.txt", "C:\UpdateVersion.txt")
    ProgressOn("Checking Resource", "Checking Resource")
    Sleep(1000)
    ProgressSet(20, "Checking Resource", "20 %")
    Sleep(1000)
    ProgressSet(50, "Checking Resource", "50 %")
    Sleep(1000)
    ProgressSet(100, "Checking Resource", "100 %")
    Sleep(500)
    ProgressOff()
    _Func ()
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Func ()
    $IpRead = FileReadLine("Launcher.txt", 6)
    $Ip = ($IpRead)
    Local $meinarray
    InetGet($Ip &"/file.list",@ScriptDir &"\file.list")
    $filename = (@ScriptDir &"\file.list")
    $FILEPATH = (@ScriptDir &"\file.txt")
    $hFile = FileOpen($filename,0)
    _FilereadToArray($filename, $meinarray)
    _FileWriteFromArray($FILEPATH, $meinarray)
    $split = StringRegExp(FileRead(FileOpen(@ScriptDir & '\file.txt', 0)), '(?<=\n|\A).*(?=,)', 3)
    $file = FileOpen("UpdInf.txt",2)
    For $i = 0 To Ubound($split) -1
    FileWrite("UpdInf.txt", $split[$i] & @crlf)
    Next
    $filename1 = @ScriptDir & '\UpdInf.txt'
    $filename2 = @ScriptDir & '\UpdInf2.txt'
    Local $meinarray1
    Local $nLfd
    _FileReadToArray($filename1,$meinarray1)
    For $nLfd = 1 To $meinarray1[0]
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\\','\/')
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\./','/')
    Next
    _FileWriteFromArray($filename1,$meinarray1,1,$meinarray1[0])
    $filename1 = @ScriptDir & '\UpdInf.txt'
    $filename2 = @ScriptDir & '\UpdInf2.txt'
    Local $meinarray1
    Local $nLfd
    _FileReadToArray($filename1,$meinarray1)
    For $nLfd = 1 To $meinarray1[0]
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\/','\\')
    $meinarray1[$nLfd] = StringRegExpReplace($meinarray1[$nLfd],'\.\','\\')
    Next
    _FileWriteFromArray($filename2,$meinarray1,1,$meinarray1[0])
    ProgressOn("Updating KalOnline", "KalOnline-Update in Progress", "Update")
    $filename0 = FileOpen("UpdInf.txt",0)
    $filename3 = FileOpen("UpdInf2.txt",0)
    ProgressSet(0,"0%")
    Local $der
    $der = FileReadLine("file.txt", 1)
    for $i = 1 to $der
    $1 = FileReadLine($filename0,$i)
    $2 = FileReadLine($filename3,$i)
    Inetget($Ip&$1,@ScriptDir &$2)
    If $i = 1 Then ProgressSet(5,"5 %")
    If $i = $der/10 Then ProgressSet(10,"10 %")
    If $i = $der/8 Then ProgressSet(40,"40 %")
    If $i = $der/6 Then ProgressSet(50,"50 %")
    If $i = $der/5 Then ProgressSet(60,"60 %")
    If $i = $der/4 Then ProgressSet(70,"70 %")
    If $i = $der/3 Then ProgressSet(80,"80 %")
    If $i = $der/2 Then ProgressSet(90,"90 %")
    If $i = $der Then ProgressSet(95,"95 %")
    Next
    ProgressSet(100,"100 %")
    Sleep(200)
    ProgressOff()
    FileClose(@ScriptDir &"UpdInf.txt")
    FileClose(@ScriptDir &"UpdInf2.txt")
    FileClose(@ScriptDir &"file.list")
    FileClose(@ScriptDir &"file.txt")
    FileDelete(@ScriptDir &"UpdInf.txt")
    FileDelete(@ScriptDir &"UpdInf2.txt")
    FileDelete(@ScriptDir &"file.list")
    FileDelete(@ScriptDir &"file.txt")
    MsgBox(0,"Updates", "All Updates Finished", 1)
    MsgBox(0,"Updates", "All Updates Finished", 1)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Start ()
    ShellExecute("engine.exe","/load /config debug")
    Endfunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _WEB ()
    ShellExecute($HTT)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Set ()
    FileInstall("Reso.exe","Reso.exe")
    MsgBox(0, "Setting", "Here you can change the Game Resolution, other settings please change in Game",4)
    Sleep(500)
    Run("Reso.exe")
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Close ()
    Exit
    Endfunc

    [/autoit]

    MFG FireFlyer

    *Paradox ist, wenn man sich im Handumdrehen den Fuss bricht* :D

  • Hallo FireFlyer.

    So wie es ausschaut, eine sehr schöne Lösung.

    Schöne wäre es, wenn Du für spätere User und für User, die Verständnisprobleem haben, die Text-Files und List-Files einmal posten würdest.

    Ein User muß auch die Text- und List-Files verstehen und das wird sonst für einige echt ein Problem.

    Gerade anhand Deines Beispieles könnte man darauf dann nämlich gut eine User darauf hinweisen, das dort die Antwort auf die Frage hier im Beitrag incl. Beispiel-Dateien zu finden ist.
    Das würde dann nämlich auch den Mod's, Admin's und Usern viel Zeit sparen bei der Hilfeleistung.

    Vielleicht magst es ja noch posten? Dir wären dafür sicherlich viele User dankbar.

    Gruß, Crazy-A(lina).

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr

    2 Mal editiert, zuletzt von Crazy-A (1. Juni 2008 um 15:48)

  • Hallo Eistee.

    Hier mal ein Scriptpaar, wo ich aber nicht sagen kann, wo es genau her kommt.

    Auf dem lokalen PC folgenden Script :

    Spoiler anzeigen
    [autoit]


    $loader = GUICreate("Mach ein Update", 500, 400, -1, -1)
    GUISetIcon("icon.ico", -1, $loader)
    ;Random Pic Script... MINE!!
    $random = Random(1, 15)
    $int = Int($random)
    GUICtrlCreatePic("bild.jpg", 0, 0, 500, 400)
    $progress = GUICtrlCreateProgress(0, 0, 500, 17)
    GUISetState(@SW_SHOW)
    GUICtrlSetData($progress, 0)

    [/autoit] [autoit][/autoit] [autoit]

    Sleep(1000)

    [/autoit] [autoit][/autoit] [autoit]

    ; Startet den Download vom angegebenen Serverpfad
    InetGet("http://home.foni.net/autoit/update1.exe", "update1.exe")
    If @error Then
    $pingcheck = Ping("http://www.google.de")
    If $pingcheck = 0 Then
    MsgBox(0, "Uh-oh!", "Error beim downloaden der Datei: Verbindung zum Internet fehlerhaft!", 20)
    Exit
    ElseIf $pingcheck > 0 Then
    MsgBox(0, "Oh-oh!", "Sorry, da ist wohl ein Fehler.", 20)
    Exit
    EndIf
    EndIf
    Sleep(1000)
    Run(@ScriptDir & "\update1.exe")

    [/autoit]

    Auf dem Server folgenden Script:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    ; !!!! ACHTUNG !!!!
    ; !!!! Vor dem ändern an die INI-Datei denken !!!!

    [/autoit] [autoit][/autoit] [autoit]

    $checkversion = IniRead("hmoption.ini", "Settings", "version", "")
    $updatewin = GUICreate("Mach ein Update", 378, 87, 0, 0)
    GUISetBkColor(0xC0FFC0, $updatewin)
    GUISetState(@SW_SHOW, $updatewin)
    WinSetTrans("Mach ein Update", "", 175)
    If $checkversion = "2.0.0" Then
    GUICtrlCreateLabel("Es gibt derzeitig kein neues Update...", 10, 60, 253, 17)
    GUICtrlSetBKColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    Sleep(4000)
    Exit
    Else
    $progress = GUICtrlCreateProgress(10, 10, 360, 17)
    GUICtrlSetData($progress, 0)
    If ProcessExists("hm.exe") Then
    ProcessClose("hm.exe")
    If WinActive("Mach ein Update") Then
    WinClose("Mach ein Update")
    $step1 = GUICtrlCreateLabel("Erstelle 'splash'", 10, 60, 102, 17)
    DirCreate("splash")
    GUICtrlSetData($progress, 5)
    GUICtrlDelete($step1)
    $step2 = GUICtrlCreateLabel("Entpacke 'hm.exe'", 10, 60, 92, 17)
    FileInstall("hm.exe", "hm.exe", 1)
    GUICtrlSetData($progress, 10)
    GUICtrlDelete($step2)
    $step3 = GUICtrlCreateLabel("Entpacke 'option.exe'", 10, 60, 107, 17)
    FileInstall("option.exe", "option.exe", 1)
    GUICtrlSetData($progress, 15)
    GUICtrlDelete($step3)
    $step4 = GUICtrlCreateLabel("Entpacke 'hm.ico'", 10, 60, 89, 17)
    FileInstall("hm.ico", "hm.ico", 1)
    GUICtrlSetData($progress, 20)
    GUICtrlDelete($step4)
    $step5 = GUICtrlCreateLabel("Entpacke 'splash\splash1.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash1.jpg", "splash\splash1.jpg")
    GUICtrlSetData($progress, 25)
    GUICtrlDelete($step5)
    $step6 = GUICtrlCreateLabel("Entpacke 'splash\splash2.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash2.jpg", "splash\splash2.jpg")
    GUICtrlSetData($progress, 30)
    GUICtrlDelete($step6)
    $step7 = GUICtrlCreateLabel("Entpacke 'splash\splash3.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash3.jpg", "splash\splash3.jpg")
    GUICtrlSetData($progress, 35)
    GUICtrlDelete($step7)
    $step8 = GUICtrlCreateLabel("Entpacke 'splash\splash4.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash4.jpg", "splash\splash4.jpg")
    GUICtrlSetData($progress, 40)
    GUICtrlDelete($step8)
    $step9 = GUICtrlCreateLabel("Entpacke 'splash\splash5.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash5.jpg", "splash\splash5.jpg")
    GUICtrlSetData($progress, 45)
    GUICtrlDelete($step9)
    $step10 = GUICtrlCreateLabel("Entpacke 'splash\splash6.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash6.jpg", "splash\splash6.jpg")
    GUICtrlSetData($progress, 50)
    GUICtrlDelete($step10)
    $step11 = GUICtrlCreateLabel("Entpacke 'splash\splash7.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash7.jpg", "splash\splash7.jpg")
    GUICtrlSetData($progress, 55)
    GUICtrlDelete($step11)
    $step12 = GUICtrlCreateLabel("Entpacke 'splash\splash8.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash8.jpg", "splash\splash8.jpg")
    GUICtrlSetData($progress, 60)
    GUICtrlDelete($step12)
    $step13 = GUICtrlCreateLabel("Entpacke 'splash\splash9.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash9.jpg", "splash\splash9.jpg")
    GUICtrlSetData($progress, 65)
    GUICtrlDelete($step13)
    $step14 = GUICtrlCreateLabel("Entpacke 'splash\splash10.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash10.jpg", "splash\splash10.jpg")
    GUICtrlSetData($progress, 70)
    GUICtrlDelete($step14)
    $step15 = GUICtrlCreateLabel("Entpacke 'splash\splash11.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash11.jpg", "splash\splash11.jpg")
    GUICtrlSetData($progress, 75)
    GUICtrlDelete($step15)
    $step16 = GUICtrlCreateLabel("Entpacke 'splash\splash12.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash12.jpg", "splash\splash12.jpg")
    GUICtrlSetData($progress, 80)
    GUICtrlDelete($step16)
    $step17 = GUICtrlCreateLabel("Entpacke 'splash\splash13.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash13.jpg", "splash\splash13.jpg")
    GUICtrlSetData($progress, 85)
    GUICtrlDelete($step17)
    $step18 = GUICtrlCreateLabel("Entpacke 'splash\splash14.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash14.jpg", "splash\splash14.jpg")
    GUICtrlSetData($progress, 90)
    GUICtrlDelete($step18)
    $step19 = GUICtrlCreateLabel("Entpacke 'splash\splash15.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash15.jpg", "splash\splash15.jpg")
    GUICtrlSetData($progress, 95)
    GUICtrlDelete($step19)
    $step20 = GUICtrlCreateLabel("Schreibe die neue Versionsnummer in die INI-Datei", 10, 60, 150, 17)
    IniWrite("hmoption.ini", "Settings", "version", "2.0.0") ; !!!! ACHTUNG !!!!!
    GUICtrlSetData($progress, 100)
    GUICtrlCreateLabel("Update auf v2.0.0 komplett", 10, 60, 146, 17)
    Sleep(5000)
    Exit
    Else
    $step1 = GUICtrlCreateLabel("Creating Dir 'splash'", 10, 60, 102, 17)
    DirCreate("splash")
    GUICtrlSetData($progress, 5)
    GUICtrlDelete($step1)
    $step2 = GUICtrlCreateLabel("Entpacke 'hm.exe'", 10, 60, 92, 17)
    FileInstall("hm.exe", "hm.exe", 1)
    GUICtrlSetData($progress, 10)
    GUICtrlDelete($step2)
    $step3 = GUICtrlCreateLabel("Entpacke 'option.exe'", 10, 60, 107, 17)
    FileInstall("option.exe", "option.exe", 1)
    GUICtrlSetData($progress, 15)
    GUICtrlDelete($step3)
    $step4 = GUICtrlCreateLabel("Entpacke 'hm.ico'", 10, 60, 89, 17)
    FileInstall("hm.ico", "hm.ico", 1)
    GUICtrlSetData($progress, 20)
    GUICtrlDelete($step4)
    $step5 = GUICtrlCreateLabel("Entpacke 'splash\splash1.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash1.jpg", "splash\splash1.jpg")
    GUICtrlSetData($progress, 25)
    GUICtrlDelete($step5)
    $step6 = GUICtrlCreateLabel("Entpacke 'splash\splash2.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash2.jpg", "splash\splash2.jpg")
    GUICtrlSetData($progress, 30)
    GUICtrlDelete($step6)
    $step7 = GUICtrlCreateLabel("Entpacke 'splash\splash3.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash3.jpg", "splash\splash3.jpg")
    GUICtrlSetData($progress, 35)
    GUICtrlDelete($step7)
    $step8 = GUICtrlCreateLabel("Entpacke 'splash\splash4.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash4.jpg", "splash\splash4.jpg")
    GUICtrlSetData($progress, 40)
    GUICtrlDelete($step8)
    $step9 = GUICtrlCreateLabel("Entpacke 'splash\splash5.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash5.jpg", "splash\splash5.jpg")
    GUICtrlSetData($progress, 45)
    GUICtrlDelete($step9)
    $step10 = GUICtrlCreateLabel("Entpacke 'splash\splash6.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash6.jpg", "splash\splash6.jpg")
    GUICtrlSetData($progress, 50)
    GUICtrlDelete($step10)
    $step11 = GUICtrlCreateLabel("Entpacke 'splash\splash7.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash7.jpg", "splash\splash7.jpg")
    GUICtrlSetData($progress, 55)
    GUICtrlDelete($step11)
    $step12 = GUICtrlCreateLabel("Entpacke 'splash\splash8.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash8.jpg", "splash\splash8.jpg")
    GUICtrlSetData($progress, 60)
    GUICtrlDelete($step12)
    $step13 = GUICtrlCreateLabel("Entpacke 'splash\splash9.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash9.jpg", "splash\splash9.jpg")
    GUICtrlSetData($progress, 65)
    GUICtrlDelete($step13)
    $step14 = GUICtrlCreateLabel("Entpacke 'splash\splash10.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash10.jpg", "splash\splash10.jpg")
    GUICtrlSetData($progress, 70)
    GUICtrlDelete($step14)
    $step15 = GUICtrlCreateLabel("Entpacke 'splash\splash11.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash11.jpg", "splash\splash11.jpg")
    GUICtrlSetData($progress, 75)
    GUICtrlDelete($step15)
    $step16 = GUICtrlCreateLabel("Entpacke 'splash\splash12.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash12.jpg", "splash\splash12.jpg")
    GUICtrlSetData($progress, 80)
    GUICtrlDelete($step16)
    $step17 = GUICtrlCreateLabel("Entpacke 'splash\splash13.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash13.jpg", "splash\splash13.jpg")
    GUICtrlSetData($progress, 85)
    GUICtrlDelete($step17)
    $step18 = GUICtrlCreateLabel("Entpacke 'splash\splash14.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash14.jpg", "splash\splash14.jpg")
    GUICtrlSetData($progress, 90)
    GUICtrlDelete($step18)
    $step19 = GUICtrlCreateLabel("Entpacke 'splash\splash15.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash15.jpg", "splash\splash15.jpg")
    GUICtrlSetData($progress, 95)
    GUICtrlDelete($step19)
    $step20 = GUICtrlCreateLabel("Schreibe die neue Versionsnummer in die INI-Datei", 10, 60, 150, 17)
    IniWrite("hmoption.ini", "Settings", "version", "2.0.0")
    GUICtrlSetData($progress, 100)
    GUICtrlCreateLabel("Update auf v2.0.0 komplett", 10, 60, 146, 17)
    Sleep(5000)
    Exit
    EndIf
    Else
    $step1 = GUICtrlCreateLabel("Erstelle 'splash'", 10, 60, 102, 17)
    DirCreate("splash")
    GUICtrlSetData($progress, 5)
    GUICtrlDelete($step1)
    $step2 = GUICtrlCreateLabel("Entpacke 'hm.exe'", 10, 60, 92, 17)
    FileInstall("hm.exe", "hm.exe", 1)
    GUICtrlSetData($progress, 10)
    GUICtrlDelete($step2)
    $step3 = GUICtrlCreateLabel("Entpacke 'option.exe'", 10, 60, 107, 17)
    FileInstall("option.exe", "option.exe", 1)
    GUICtrlSetData($progress, 15)
    GUICtrlDelete($step3)
    $step4 = GUICtrlCreateLabel("Entpacke 'hm.ico'", 10, 60, 89, 17)
    FileInstall("hm.ico", "hm.ico", 1)
    GUICtrlSetData($progress, 20)
    GUICtrlDelete($step4)
    $step5 = GUICtrlCreateLabel("Entpacke 'splash\splash1.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash1.jpg", "splash\splash1.jpg")
    GUICtrlSetData($progress, 25)
    GUICtrlDelete($step5)
    $step6 = GUICtrlCreateLabel("Entpacke 'splash\splash2.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash2.jpg", "splash\splash2.jpg")
    GUICtrlSetData($progress, 30)
    GUICtrlDelete($step6)
    $step7 = GUICtrlCreateLabel("Entpacke 'splash\splash3.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash3.jpg", "splash\splash3.jpg")
    GUICtrlSetData($progress, 35)
    GUICtrlDelete($step7)
    $step8 = GUICtrlCreateLabel("Entpacke 'splash\splash4.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash4.jpg", "splash\splash4.jpg")
    GUICtrlSetData($progress, 40)
    GUICtrlDelete($step8)
    $step9 = GUICtrlCreateLabel("Entpacke 'splash\splash5.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash5.jpg", "splash\splash5.jpg")
    GUICtrlSetData($progress, 45)
    GUICtrlDelete($step9)
    $step10 = GUICtrlCreateLabel("Entpacke 'splash\splash6.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash6.jpg", "splash\splash6.jpg")
    GUICtrlSetData($progress, 50)
    GUICtrlDelete($step10)
    $step11 = GUICtrlCreateLabel("Entpacke 'splash\splash7.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash7.jpg", "splash\splash7.jpg")
    GUICtrlSetData($progress, 55)
    GUICtrlDelete($step11)
    $step12 = GUICtrlCreateLabel("Entpacke 'splash\splash8.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash8.jpg", "splash\splash8.jpg")
    GUICtrlSetData($progress, 60)
    GUICtrlDelete($step12)
    $step13 = GUICtrlCreateLabel("Entpacke 'splash\splash9.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash9.jpg", "splash\splash9.jpg")
    GUICtrlSetData($progress, 65)
    GUICtrlDelete($step13)
    $step14 = GUICtrlCreateLabel("Entpacke 'splash\splash10.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash10.jpg", "splash\splash10.jpg")
    GUICtrlSetData($progress, 70)
    GUICtrlDelete($step14)
    $step15 = GUICtrlCreateLabel("Entpacke 'splash\splash11.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash11.jpg", "splash\splash11.jpg")
    GUICtrlSetData($progress, 75)
    GUICtrlDelete($step15)
    $step16 = GUICtrlCreateLabel("Entpacke 'splash\splash12.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash12.jpg", "splash\splash12.jpg")
    GUICtrlSetData($progress, 80)
    GUICtrlDelete($step16)
    $step17 = GUICtrlCreateLabel("Entpacke 'splash\splash13.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash13.jpg", "splash\splash13.jpg")
    GUICtrlSetData($progress, 85)
    GUICtrlDelete($step17)
    $step18 = GUICtrlCreateLabel("Entpacke 'splash\splash14.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash14.jpg", "splash\splash14.jpg")
    GUICtrlSetData($progress, 90)
    GUICtrlDelete($step18)
    $step19 = GUICtrlCreateLabel("Entpacke 'splash\splash15.jpg'", 10, 60, 146, 17)
    FileInstall("splash\splash15.jpg", "splash\splash15.jpg")
    GUICtrlSetData($progress, 95)
    GUICtrlDelete($step19)
    $step20 = GUICtrlCreateLabel("Schreibe die neue Versionsnummer in die INI-Datei", 10, 60, 150, 17)
    IniWrite("hmoption.ini", "Settings", "version", "2.0.0")
    GUICtrlSetData($progress, 100)
    GUICtrlCreateLabel("Update auf v2.0.0 komplett", 10, 60, 146, 17)
    Sleep(5000)
    Exit
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Sleep(1)
    WEnd

    [/autoit]

    Und damit Du es möglichst schnell testen kannst, als Anlage alles incl. INI, Bild, usw.

    Gruß, Crazy-A(Lina)

    Dateien

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr

    • Offizieller Beitrag

    Hallo

    [autoit]

    $file = InetGetSize("http://keineahnung.de/test.exe")
    If $file = 0 Then ...

    [/autoit]

    Ist sehr unsauber, da die Datei ja auch Theoretisch 0 bytes groß sein kann, oder? ;)

    Das hier ist sauberer:

    Spoiler anzeigen
    [autoit]

    $file = InetGetSize("http://keineahnung.de/test.exe")
    If @error Then
    MsgBox(0, "Error", "Diese Datei existiert nicht")
    ElseIf $file > 0 Then
    MsgBox(0, "Success", "Die Datei existiert und ist "&$file&" Bytes groß")
    EndIf

    [/autoit]
    • Offizieller Beitrag

    Mit dem gleichen Argument, GTA:

    [autoit]

    $file = InetGetSize("http://keineahnung.de/test.exe")
    If @error Then
    MsgBox(0, "Error", "Diese Datei existiert nicht")
    Else
    MsgBox(0, "Success", "Die Datei existiert und ist "&$file&" Bytes groß")
    EndIf

    [/autoit]

    ;)

    peethebee

    Edit Spider: Ah, danke pee, hab "ElseIf $file > 0 Then" vergessen ;)

  • Zitat

    mein Problem ist wenn hinter der angegebenen URL (hinter der die UpdateVersion.txt hinterlegt ist) nichts ist bzw. die URL nicht erreichbar ist startet er die UpdateFunktion weil er nichts zum Vergleichen hatt daher wollte ich fragen ob ich irgendwie vorher prüfen kann ob die url erreichbar ist und ob die datei hinter der url liegt

    Lest genauer ;)
    Wenn die Datei jetzt leer wäre hat er genau so einen String mit "" oder 0 d.h. Das Programm würde auch dann weitermachen und seinen Fehler erzeugen deswegen hab ich wirklich die dateigröße gewählt damit in der Datei auch was drinstehn muss ;)

    MFG FireFlyer

    *Paradox ist, wenn man sich im Handumdrehen den Fuss bricht* :D

  • Mach doch ein Pinkcheck.

    Bsp.: $pingcheck = Ping("http://www.die_hilfe_ist_mein_bester_freund.de")

    Crazy-A

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr