Moin,
dies ist ein automatischer Updater für AutoIt v3. Er prüft regelmässig einmal pro Stunde
auf Updates und lädt diese auf Wunsch herunter.
Bin bis jetzt soweit gekommen...
Auto(It)-Updater v1.0.9.0 24.o8.2oo7
Setup/Installer
Spoiler anzeigen
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=E:\AutoIt Projekte\Icons\shell32\shell32_16717.ico
#AutoIt3Wrapper_outfile=SetupAU3updater.exe
#AutoIt3Wrapper_Res_Comment=Setup Updater für AutoIt
#AutoIt3Wrapper_Res_Description=Setup Updater für AutoIt
#AutoIt3Wrapper_Res_Fileversion=1.0.8.0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.2.4.9
Author: Greenhorn
Script Function:
Setup
Auto(It)-Updater v1.0.8
#ce ----------------------------------------------------------------------------
FileInstall("AutoIt_Updater.exe", @CommonFilesDir & "\AutoIt3\AutoIt_Updater.exe", 1)
FileInstall("Uninst.exe", @ProgramFilesDir & "\AutoIt3\Uninst_Updater.exe", 1)
; Verknüpfung in der Schnellstartleiste erstellen --> Uploader startet SciTE
FileCreateShortcut(@CommonFilesDir & "\AutoIt3\AutoIt_Updater.exe", @AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\SciTE", _
"", "", "", @ProgramFilesDir & "\AutoIt3\SciTE\SciTe.exe")
; Registryeinträge für das Kontextmenü vornehmen
RegWrite("HKLM\Software\Classes\AutoIt3Script\Shell\Edit\Command", "", "REG_SZ", _
'"' & @CommonFilesDir & "\AutoIt3\AutoIt_Updater.exe" & '" "%1"')
RegWrite("HKLM\Software\Classes\AutoIt3Script\Shell\Open\Command", "", "REG_SZ", _
'"' & @CommonFilesDir & "\AutoIt3\AutoIt_Updater.exe" & '" "%1"')
Main Program
Spoiler anzeigen
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Icons\updater_1003.ico
#AutoIt3Wrapper_outfile=C:\Programme\Gemeinsame Dateien\AutoIt3\Au3UPDATER.exe
#AutoIt3Wrapper_Res_Comment=Automatischer Updater für AutoIt
#AutoIt3Wrapper_Res_Description=Updater für AutoIt
#AutoIt3Wrapper_Res_Fileversion=1.0.9.0
#AutoIt3Wrapper_Res_Language=1031
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs -------------------------------------------------------------------------------
; Auto(It)-Updater v1.0.9
;
; AutoIt Version: 3.2.4.9
; Author: Greenhorn
;
; Script Function: Self-controlled Update Checker for AutoIt v3.
; Starts everytime 'SciTE for AutoIt' is called and checks
; every hour for updates while SciTE is running.
; Also it installs the Update if you want.
;
;
; Thx to Eddy Erpel for support
#ce -------------------------------------------------------------------------------
If $cmdline[0] <> 0 Then
Run(RegRead("HKLM\Software\AutoIt v3\Autoit", "InstallDir") & "\SciTE\SciTE.exe " & '"' & $cmdline[1] & '"') ; Start SciTE
Else
ShellExecute(@ProgramFilesDir & "\AutoIt3\SciTE\SciTE.exe") ; Start SciTE
EndIf
RegWrite("HKLM\SOFTWARE\Classes\AutoIt3Script\Shell\Edit\Command", _ ; Registryeinträge bei Programmstart auf SciTE setzen.
"", "REG_SZ", '"' & @ProgramFilesDir & "\AutoIt3\SciTE\SciTE.exe" & '" "%1"') ; Dies verhindert mehrere Instanzen von AutoIt_Updater.exe
RegWrite("HKLM\SOFTWARE\Classes\AutoIt3Script\Shell\Open\Command", _ ; beim öffnen von .au3 Dateien
"", "REG_SZ", '"' & @ProgramFilesDir & "\AutoIt3\SciTE\SciTE.exe" & '" "%1"')
Opt("OnExitFunc", "_Install_Updates")
Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)
HotKeySet("^!u", "_UpdateCheck") ; Control + Alt + u drücken um auf Updates zu prüfen
Dim $CurrentFileVersion
Dim $UpdateIni
Dim $NewVersion
Dim $Install = 0
_UpdateCheck() ; Bei Programmstart auf Updates prüfen ...
[/autoit] [autoit][/autoit] [autoit]Do ; Update Automatik - Einmal pro Stunde auf neue Version prüfen ...
If @MIN = 59 Then _UpdateCheck()
Sleep(10000)
Until ProcessExists("SciTE.exe") = 0 ; ... bis SciTE beendet wird.
Exit
Func _UpdateCheck()
$Ping = Ping("www.AutoItScript.com", 250)
If $Ping Then
$CurrentFileVersion = FileGetVersion(@ProgramFilesDir & "\AutoIt3\AutoIt3.exe")
$UpdateIni = StringSplit(StringRegExpReplace(_INetGetSource("http://www.autoitscript.com/autoit3/files/beta/update.dat"), @LF, ''),@CR)
If StringInStr($UpdateIni[2], $CurrentFileVersion) Then
Sleep(60000)
Else
$Date = StringRegExp($UpdateIni[6], '[0-9]', 3)
$Year = _ArrayToString($Date, '', 0, 3)
$Month = _ArrayToString($Date, '', 4, 5)
$Day = _ArrayToString($Date, '', 6, 7)
$WhatToDo = MsgBox(68, "AutoIt Updates", "Es sind Updates vorhanden!" & @CRLF & "" & @CRLF & _
"Installierte Version: AutoIT v" & $CurrentFileVersion & @CRLF & "" & @CRLF & _
"Verfügbare Version: AutoIT v" & $UpdateIni[2] & " (" & $Day & "." & $Month & "." & $Year & ")" & @CRLF & "" & @CRLF & _
"Updates herunterladen ?")
Select
Case $WhatToDo = 6 ; Ja, Updates herunterladen
InetGet(StringRegExpReplace($UpdateIni[4], 'setup=', ''), _
@DesktopDir & "\autoit-v" & $UpdateIni[2] & "-setup.exe", 1, 1)
InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @CommonFilesDir & "\Update.ini")
While @InetGetActive
TraySetState(1)
TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)
Sleep(250)
WEnd
$WhatToDoNow = MsgBox(68, "AutoIt Udates", "Updates wurden heruntergeladen!" & @CRLF & "" & @CRLF & _
"Sollen die Udates jetzt installiert werden?", 20)
Select
Case $WhatToDoNow = 6 ; Ja, Updates installieren
MsgBox(48, "AutoIt Udates", "Bitte beenden Sie alle Instanzen von SciTE !")
$Install = 1
$NewVersion = $UpdateIni[2]
Case $WhatToDoNow = 7 ; Nein, Updates nicht installieren
Exit
EndSelect
Exit
Case $WhatToDo = 7 ; Nein, Updates nicht herunterladen
Exit
EndSelect
EndIf
Else
Sleep(30000)
EndIf
Sleep(30000)
EndFunc ;==>_UpdateCheck
Func _Install_Updates()
If FileExists(@DesktopDir & "\autoit-" & $NewVersion & "-setup.exe") And $Install = 1 Then
ShellExecuteWait(@DesktopDir & "\autoit-" & $NewVersion & "-setup.exe", "/S") ; Silent Installation
RegWrite("HKLM\Software\Classes\AutoIt3Script\Shell\Edit\Command", "", "REG_SZ", _
'"' & @CommonFilesDir & "\AutoIt3\AutoIt_Updater.exe" & '" "%1"') ; Registryeinträge nach Installation zurücksetzen
RegWrite("HKLM\Software\Classes\AutoIt3Script\Shell\Open\Command", "", "REG_SZ", _
'"' & @CommonFilesDir & "\AutoIt3\AutoIt_Updater.exe" & '" "%1"')
MsgBox(64, "AutoIt Udates", "Updates wurden erfolgreich installiert!")
;Run(@ProgramFilesDir & '\AutoIt3\SciTE\SciTE.exe')
Else
RegWrite("HKLM\Software\Classes\AutoIt3Script\Shell\Edit\Command", "", "REG_SZ", _
'"' & @CommonFilesDir & "\AutoIt3\AutoIt_Updater.exe" & '" "%1"') ; Registryeinträge bei Programmende zurücksetzen
RegWrite("HKLM\Software\Classes\AutoIt3Script\Shell\Open\Command", "", "REG_SZ", _
'"' & @CommonFilesDir & "\AutoIt3\AutoIt_Updater.exe" & '" "%1"')
Exit
EndIf
EndFunc ;==>_Install_Updates
#Region User Defiened Funktions
Func _ArrayToString(Const ByRef $avArray, $sDelim, $iStart = Default, $iEnd = Default)
; Declare local variables.
Local $iUBound = UBound($avArray) - 1
; Validate the array
If ($iUBound + 1) < 2 Or UBound($avArray, 0) > 1 Then Return SetError(1, 0, "")
; Expand Default parameters
If $iStart = Default Or $iStart = -1 Then $iStart = 0
If $iEnd = Default Or $iEnd = -1 Then $iEnd = $iUBound
; Validate that the start and end indices are valid.
If ($iStart < 0) Or ($iEnd < 0) Or ($iStart > $iEnd) Then Return SetError(2, 0, "")
; Make sure that $iEnd <= to the size of the array.
If ($iEnd > $iUBound) Then
$iEnd = $iUBound
EndIf
Local $sResult
; Combine the elements into the string.
For $i = $iStart To $iEnd
$sResult &= $avArray[$i] & $sDelim
Next
Return StringTrimRight($sResult, StringLen($sDelim))
EndFunc ;==>_ArrayToString
Func _INetGetSource($s_URL, $s_Header = '')
If StringLeft($s_URL, 7) <> 'http://' And StringLeft($s_URL, <> 'https://' Then $s_URL = 'http://' & $s_URL
Local $h_DLL = DllOpen("wininet.dll")
Local $ai_IRF, $s_Buf = ''
Local $ai_IO = DllCall($h_DLL, 'int', 'InternetOpen', 'str', "AutoIt v3", 'int', 0, 'int', 0, 'int', 0, 'int', 0)
If @error Or $ai_IO[0] = 0 Then
DllClose($h_DLL)
SetError(1)
Return ""
EndIf
Local $ai_IOU = DllCall($h_DLL, 'int', 'InternetOpenUrl', 'int', $ai_IO[0], 'str', $s_URL, 'str', $s_Header, 'int', StringLen($s_Header), 'int', 0x80000000, 'int', 0)
If @error Or $ai_IOU[0] = 0 Then
DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0])
DllClose($h_DLL)
SetError(1)
Return ""
EndIf
Local $v_Struct = DllStructCreate('udword')
DllStructSetData($v_Struct, 1, 1)
While DllStructGetData($v_Struct, 1) <> 0
$ai_IRF = DllCall($h_DLL, 'int', 'InternetReadFile', 'int', $ai_IOU[0], 'str', '', 'int', 256, 'ptr', DllStructGetPtr($v_Struct))
$s_Buf &= StringLeft($ai_IRF[2], DllStructGetData($v_Struct, 1))
WEnd
DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IOU[0])
DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0])
DllClose($h_DLL)
Return $s_Buf
EndFunc ;==>_INetGetSource
#EndRegion User Defiened Funktions
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]Uninstall
Spoiler anzeigen
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.2.4.9
Author: Greenhorn
Script Function: Uninstaller
Auto(It)-Updater v1.0.5
#ce ----------------------------------------------------------------------------
#Region AutoIt3Wrapper directives section
#AutoIt3Wrapper_icon=E:\AutoIt Projekte\Icons\shell32\shell32_33.ico
#AutoIt3Wrapper_res_comment=Deinstalliert Updater für AutoIt
#AutoIt3Wrapper_res_description=Deinstalliert Updater für AutoIt
#AutoIt3Wrapper_res_fileversion=1.0.5.0
#EndRegion
#NoTrayIcon
; Registryeinträge zurücksetzen wenn AutoIt und SciTE noch installert ist...
If FileExists(@ProgramFilesDir & "\AutoIt3\AutoIt3.exe") And FileExists(@ProgramFilesDir & "\AutoIt3\SciTE\SciTE.exe") Then
RegWrite("HKLM\Software\Classes\AutoIt3Script\Shell\Edit\Command", "", "REG_SZ", '"' & @ProgramFilesDir & '"\AutoIt3\SciTE\SciTE.exe" "%1"')
RegWrite("HKLM\Software\Classes\AutoIt3Script\Shell\Open\Command", "", "REG_SZ", '"' & @ProgramFilesDir & '"\AutoIt3\SciTE\SciTE.exe" "%1"')
FileDelete(@CommonFilesDir & "\AutoIt3")
If @error = 0 Then
MsgBox(64, "Uninstall", "Deinstallation fehlgeschlagen!" & @CRLF & @CRLF & "AutoIt_Updater.exe konnte nicht gelöscht werden.")
Else
MsgBox(64, "Uninstall", "Das Programm wurde erfolgreich deinstalliert!")
EndIf
; Registryeinträge umschreiben wenn AutoIt noch installert ist und ein anderer Editor benutzt wird...
ElseIf FileExists(@ProgramFilesDir & "\AutoIt3\AutoIt3.exe") And Not FileExists(@ProgramFilesDir & "\AutoIt3\SciTE\SciTE.exe") Then
MsgBox(64, "Uninstall", "AutoIt ist auf Ihrem System installiert," & @CRLF & @CRLF & "jedoch konnte SciTE nicht gefunden werden." & @CRLF & @CRLF & "Wenn Sie einen anderen Editor benutzen," & @CRLF & "geben sie bitte den Pfad ein.")
$Editor = FileOpenDialog("Editor suchen", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "*.exe", 1)
RegWrite("HKLM\Software\Classes\AutoIt3Script\Shell\Edit\Command", "", "REG_SZ", '"' & $Editor & '" "%1"')
RegWrite("HKLM\Software\Classes\AutoIt3Script\Shell\Open\Command", "", "REG_SZ", '"' & $Editor & '" "%1"')
FileDelete(@CommonFilesDir & "\AutoIt3")
If @error = 0 Then
MsgBox(64, "Uninstall", "Deinstallation fehlgeschlagen!" & @CRLF & @CRLF & "AutoIt_Updater.exe konnte nicht gelöscht werden.")
Else
MsgBox(64, "Uninstall", "Das Programm wurde erfolgreich deinstalliert!")
EndIf
; Andernfalls alles bereinigen...
Else
RegDelete("HKLM\Software\Classes\AutoIt3Script\Shell\Edit\Command")
RegDelete("HKLM\Software\Classes\AutoIt3Script\Open\Edit\Command")
FileDelete(@CommonFilesDir & "\AutoIt3")
If @error = 0 Then
MsgBox(64, "Uninstall", "Deinstallation fehlgeschlagen!" & @CRLF & @CRLF & "AutoIt_Updater.exe konnte nicht gelöscht werden.")
Else
MsgBox(64, "Uninstall", "Das Programm wurde erfolgreich deinstalliert!")
EndIf
EndIf
Exit
Gruß
Greenhorn
Edit: funzt hervorragend ! Test bestanden --> 25.o8.2oo7 um o1:oo Uhr Update von 3.2.4.9 auf 3.2.6.0