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
#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
$IpRead = FileReadLine("Launcher.txt", 6)
If FileExists("C:\UpdateVersion.txt") Then
_Funce ()
Else
FileWrite("C:\UpdateVersion.txt", "1234567gdertfderdvbhtt")
Sleep(1000)
_Funce ()
EndIf
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
und hoffe das so etwas realisierbar wäre
Mfg Eistee