Hallo ich hab mal wiedr ein neues problem mit InetGet.
Es wird weder die txt noch die exe geladen.
Hier der script:
Spoiler anzeigen
#RequireAdmin
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Dim $ver = IniRead(@ScriptDir & "\Version.ini","Version","Version","1.0")
HttpSetUserAgent('Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10')
If @OSArch = "X64" Then
InetGet("http://molaynox.bplaced.net/UpdateX64.txt",@ScriptDir & "\update.txt", 1, 0)
$file = FileOpen(@Scriptdir & "\update.txt", 0)
$line = FileReadLine($file, 1)
$line2 = FileReadLine($file, 2)
EndIf
If @OSArch = "X86" Then
InetGet("http://molaynox.bplaced.net/Update.txt",@ScriptDir & "\update.txt", 1, 0)
$file = FileOpen(@Scriptdir & "\update.txt", 0)
$line = FileReadLine($file, 1)
$line2 = FileReadLine($file, 2)
EndIf
If $line = $ver Then
MsgBox(64, "Kein Update", "Du hast die neuste Version: (" & $ver & ")")
FileClose($file)
FileDelete(@Scriptdir & "\update.txt")
If @OSArch = "X86" Then Run(@ScriptDir & "\BlackEyes StreamPlayer.exe")
If @OSArch = "X64" Then Run(@ScriptDir & "\BlackEyes StreamPlayerX64.exe")
Else
MsgBox(64, "Update!", "Es ist eine Neue Version verfügbar!")
$fg = MsgBox(4, "Updaten?", "Möchtest du jetzt Updaten?")
If $fg = 6 Then
HttpSetUserAgent('Firefox')
$Form1 = GUICreate("Update herunterladen", 295, 133, 193, 125)
$Progress1 = GUICtrlCreateProgress(20, 56, 260, 17)
$Label1 = GUICtrlCreateLabel("Update ...", 20, 37, 260, 17)
GUISetState(@SW_SHOW)
$Source = $line2
$aFile = StringSplit($Source, "/")
Local $dest = @ScriptDir & "\" & $aFile[$aFile[0]]
ConsoleWrite($dest & @CRLF)
Local $nBytes, $nSize = InetGetSize($Source)
Local $hDownload = InetGet($Source, $dest, 1, 1)
Do
Sleep(1000)
$nBytes = InetGetInfo($hDownload, 0)
$ipercent = Floor($nBytes / $nSize * 100)
GUICtrlSetData($Progress1, $ipercent)
GUICtrlSetData($Label1, $nBytes & " von " & $nSize & " Bytes = " & $ipercent & "% geladen")
Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
Local $aData = InetGetInfo($hDownload) ; Get all information.
InetClose($hDownload) ; Close the handle to release resourcs.
MsgBox(0, "", "Bytes read: " & $aData[0] & @CRLF & _
"Size: " & $aData[1] & @CRLF & _
"Complete?: " & $aData[2] & @CRLF & _
"Successful?: " & $aData[3] & @CRLF & _
"@error: " & $aData[4] & @CRLF & _
"@extended: " & $aData[5] & @CRLF)
MsgBox(0,"Hinweis","Bitte Programm neustarten")
If $aData[3] = True Then IniWrite("Version.ini","Version","Version",$line)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndIf
EndIf