Hallo liebe AutoIt Community,
ich muss mal vorweg sagen das ich das script von tuttifrutti abgekupfert habe. Wenns mir nicht gestattet ist bitte melden, aber ich fand das halt echt super gemacht. nur leider gehts nicht... zumindest nicht ganz.
Also... Mein Problem ist das er alles durch macht aber die Datein dann aber nich da sind
Hier mal das Script:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
Const $vUpdateServer = "crazygamingcrew.spacequadrat.de"
Const $vScriptFile = "http://www.crazygamingcrew.spacequadrat.de/spinstaller/version.txt"
Const $vChangelogFile = "http://www.crazygamingcrew.spacequadrat.de/spinstaller/changelog.txt"
Const $vUnrarDLL = "http://www.crazygamingcrew.spacequadrat.de/spinstaller/unrar.dll"
Const $vMapFiles = "http://www.crazygamingcrew.spacequadrat.de/spinstaller/changelog.rar"
HotKeySet("{END}", "_exit")
$INI = @ScriptDir & "\Data.ini"
$vVersion = "3.15b"
$vGUIColor = 0x161616
$vGUIColor2 = 0x161616
Dim $hGUIListChangelog
If Not FileExists(@ScriptDir & "\Data\") Then
DirCreate(@ScriptDir & "\Data\")
EndIf
If Not FileExists($INI) Then
IniWrite($INI, "Default", "Titel", "(C) The-Franky 2009 - 2010")
EndIf
#region UpdateGUI
;UpdateGUI
$vGUIStandartHeight = 290
$vGUILargeHeight = $vGUIStandartHeight + 327
$vGUIStandartWidth = 778
$vGUIColor = 0x161616 ;Label of BigMap needs to be changed manually (GUIFuncs.au3, Function: _SM_WritePicLabel + _SM_WorldMapExtras), also Background of Minimap (GUIFuncs.au3, Function: _SM_UnsetMiniMap)
$hGUI = GUICreate("Tralala v" & $vVersion, $vGUIStandartWidth - 6, $vGUIStandartHeight)
$hGUIUpdate = GUICreate("Tralala - Update", 500, 305, -1, -1, -1, 0x00000080, $hGUI)
GUISetBkColor($vGUIColor, $hGUIUpdate)
$hGUILabelNewVersion = GUICtrlCreateLabel("", 10, 10, 480, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$hGUIListChangelog = GUICtrlCreateList("", 10, 30, 480, 240, BitOR(0x4000, 0x0100, 0x00200000))
GUICtrlSetBkColor(-1, $vGUIColor)
GUICtrlSetColor(-1, 0xFFFFFF)
$hGUIButtonDownload = GUICtrlCreateButton("Download", 10, 275, 235, 20)
$hGUIButtonCancelUpdate = GUICtrlCreateButton("Cancel", 255, 275, 235, 20)
GUISetState(@SW_HIDE)
#endregion UpdateGUI
MainGui()
Func MainGui()
Opt("GUIOnEventMode", 0)
$maingui = GUICreate("Main Gui", 260, 175, -1, -1)
$hGUILabelUpdateAndSApfelInfo = GUICtrlCreateLabel("", 25, 14, 84, 17)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetState(-1, 32)
GUICtrlCreateLabel("Test2", 53, 38, 55, 17)
$check = GUICtrlCreateButton("Check", 10, 88, 240, 20)
$groupgeneral2 = GUICtrlCreateGroup("Info", 10, 113, 240, 42)
$Label1 = GUICtrlCreateLabel("Made by" & "Franky", 24, 128, 205, 19)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW, $maingui)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]While 1
Switch GUIGetMsg($maingui)
Case -3
Exit
Case $check
_SM_ClickUpdateCheck()
Case $hGUIButtonDownload
_SM_ClickButtonDownload()
Case $hGUIButtonCancelUpdate, $hGUIUpdate
_SM_ClickButtonCancelUpdate()
EndSwitch
Sleep(10)
WEnd
GUIDelete($maingui)
Sleep(100)
EndFunc ;==>MainGui
[/autoit] [autoit][/autoit] [autoit]Func _exit()
Sleep(10)
Exit
EndFunc ;==>_exit
Func _SM_ClickUpdateCheck()
;GUICtrlSetData($hGUILabelUpdateAndSApfelInfo, "Receiving latest SApfel Manager-Version from http://" & $vUpdateServer)
;GUICtrlSetState($hGUILabelUpdateAndSApfelInfo, 16)
_SM_UpdateCheck($vVersion)
If @error = 1 Then
MsgBox(48, "Connection timeout", "You either do not have a connection to the world wide web or the server is currently down.")
ElseIf @error = 2 Then
MsgBox(48, "Error", "Error getting the version!")
ElseIf @error = 3 Then
MsgBox(64, "No update available", "You are using the latest version (v" & $vVersion & ").")
Else
;~ GUISetState(@SW_HIDE, $FORM1)
GUISetState(@SW_SHOW, $hGUIUpdate) ;5
EndIf
;GUICtrlSetState($hGUILabelUpdateAndSApfelInfo, 32)
EndFunc ;==>_SM_ClickUpdateCheck
Func _SM_UpdateCheck($vCurrentVersion)
If Ping($vUpdateServer) = 0 Then
SetError(1)
Else
$vLatestVersion = _INetGetSource_($vScriptFile)
If @error Then
SetError(2)
Else
If $vCurrentVersion <> $vLatestVersion Then
GUICtrlSetData($hGUILabelNewVersion, "There is a new version available (old: " & $vCurrentVersion & " | new: " & $vLatestVersion & ").")
$vChangelog = StringSplit(_INetGetSource_($vChangelogFile), @CRLF)
For $i = 1 To $vChangelog[0]
GUICtrlSendMsg($hGUIListChangelog, 0x0180, 0, $vChangelog[$i])
Next
Return SetError(0, 0, $vLatestVersion)
Else
SetError(3)
EndIf
EndIf
EndIf
Return 0
EndFunc ;==>_SM_UpdateCheck
Func _INetGetSource_($s_URL, $bString = True)
Local $sString = InetRead($s_URL, 1)
Local $nError = @error, $nExtended = @extended
If $bString Then $sString = BinaryToString($sString)
Return SetError($nError, $nExtended, $sString)
EndFunc ;==>_INetGetSource_
Func _SM_ClickButtonDownload()
GUISetState(@SW_HIDE, $hGUIUpdate)
GUICtrlSetData($hGUIListChangelog, "")
;~ ShellExecute("http://" & $vUpdateServer)
_SM_MapFilesInstall()
EndFunc ;==>_SM_ClickButtonDownload
Func _SM_ClickButtonCancelUpdate()
GUISetState(@SW_HIDE, $hGUIUpdate)
;GUISetState(@SW_SHOW, $maingui)
GUICtrlSetData($hGUIListChangelog, "")
EndFunc ;==>_SM_ClickButtonCancelUpdate
Func _SM_MapFilesInstall()
$v_MapFiles = @TempDir & "\changelog.rar"
ProgressOn("Downloading...", "Loading 'unrar.dll'", "")
[/autoit] [autoit][/autoit] [autoit]$v_SizeUnrarDLL = Round(InetGetSize($vUnrarDLL) / 1024)
$hDownload = InetGet($vUnrarDLL, @TempDir & "\unrar.dll", 1, 1)
Do
$v_DLBytes = Round(InetGetInfo($hDownload, 0) / 1024)
$v_DLPercent = Round($v_DLBytes / $v_SizeUnrarDLL * 100)
ProgressSet($v_DLPercent, @LF & $v_DLBytes & "/" & $v_SizeUnrarDLL & "KB " & $v_DLPercent & "%")
Sleep(100)
Until InetGetInfo($hDownload, 2)
ProgressSet(0, "", "Loading 'changelog.rar'")
[/autoit] [autoit][/autoit] [autoit]$v_SizeMapFilesRar = Round(InetGetSize($vMapFiles) / 1024)
Local $hDownload = InetGet($vMapFiles, $v_MapFiles, 1, 1)
Do
$v_DLBytes = Round(InetGetInfo($hDownload, 0) / 1024)
$v_DLPercent = Round($v_DLBytes / $v_SizeMapFilesRar * 100)
ProgressSet($v_DLPercent, @LF & $v_DLBytes & "/" & $v_SizeMapFilesRar & "KB " & $v_DLPercent & "%")
Sleep(200)
Until InetGetInfo($hDownload, 2)
ProgressSet(100, @LF & "This may take some seconds.", "Installing changelog...")
$bExtractionSuc = _SM_RARExtract(@TempDir & "\unrar.dll", $v_MapFiles)
Sleep(2000)
[/autoit] [autoit][/autoit] [autoit]FileDelete(@TempDir & "\unrar.dll")
FileDelete($v_MapFiles)
If $bExtractionSuc = 1 Then
ProgressSet(100, @LF & "Installation done. Have fun!", "Installing changelog...")
Sleep(3000)
Else
For $i = 15 To 1 Step - 1
ProgressSet(100, "Error occured. Please make sure that you are connected" & @CRLF & "to the www and that SBot Manager was started in" & @CRLF & "32 bit mode. Continuing in " & $i & " seconds", "Installing mapfiles...")
Sleep(1000)
Next
EndIf
ProgressOff()
EndFunc ;==>_SM_MapFilesInstall
;Auto extraction of rar archives into the scriptdirectory
Func _SM_RARExtract($v_UnrarDLL, $v_RarFile) ;$v_UnrarDLL = path to unrar.dll file, $v_RarFile = path to rar file
Local $sResult
$rar_ArchivName = DllStructCreate("char[260]")
DllStructSetData($rar_ArchivName, 1, $v_RarFile)
$rar_CmtBuf = DllStructCreate("char[16384]")
For $iCount = 1 To 16384
$sResult &= " "
Next
DllStructSetData($rar_CmtBuf, 1, $sResult)
$rar_Str = DllStructCreate("ptr;uint;uint;ptr;uint;uint;uint")
[/autoit] [autoit][/autoit] [autoit]DllStructSetData($rar_Str, 1, DllStructGetPtr($rar_ArchivName))
DllStructSetData($rar_Str, 2, 1) ;1 = $RAR_OM_EXTRACT
DllStructSetData($rar_Str, 3, 0)
DllStructSetData($rar_Str, 4, DllStructGetPtr($rar_CmtBuf))
DllStructSetData($rar_Str, 5, 16384)
DllStructSetData($rar_Str, 6, 0)
DllStructSetData($rar_Str, 7, 0)
$rar_Header_CmtBuf = DllStructCreate("char[16384]")
$rar_Header_Str = DllStructCreate("char[260];char[260];uint;uint;uint;uint;uint;uint;uint;uint;uint;ptr;uint;uint;uint")
DllStructSetData($rar_Header_Str, 12, DllStructGetPtr($rar_Header_CmtBuf))
If FileExists($v_UnrarDLL) Then
$DLLUnrar = DllOpen($v_UnrarDLL)
$rar_OpenedArchive = DllCall($DLLUnrar, "int", "RAROpenArchive", "ptr", DllStructGetPtr($rar_Str))
If IsArray($rar_OpenedArchive) Then
$iCount = 0
Do
$rar_Header = DllCall($DLLUnrar, "int", "RARReadHeader", "ptr", $rar_OpenedArchive[0], "ptr", DllStructGetPtr($rar_Header_Str))
DllCall($DLLUnrar, "int", "RARProcessFile", "ptr", $rar_OpenedArchive[0], "int_ptr", 2, "ptr", "", "ptr", "") ;2 = $RAR_EXTRACT
$iCount += 1
Until $rar_Header[0] <> 0 Or $iCount = 20
DllCall($DLLUnrar, "int", "RARCloseArchive", "int", $rar_OpenedArchive[0])
DllClose($DLLUnrar)
Return 1
EndIf
EndIf
Return 0
EndFunc ;==>_SM_RARExtract
könnt das Script auch Live testen so wie es is ;P
würde mich über eure Hilfe freuen
Mit freundlichen Grüßen
LatroX