Jump to content

Recommended Posts

Posted

Hi,

I've scripted an Updater for AutoIt and now it where fine if I could find a way to start my Updater everytime SciTe is started...

I know, this is maybe not the right place to ask for, but I've found nothing in any Windows Community or by Google. :rolleyes:

But maybe someone here have an Idea to release it...

Setup/Installer

#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.2.4.9
    Author:         Greenhorn
    
    Script Function:
    Setup
         Auto(It)-Updater v1.0.3
    
#ce ----------------------------------------------------------------------------

FileInstall("AutoIt_Updater.exe", @CommonFilesDir & "\AutoIt3\AutoIt_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.ink", "", "","", @ProgramFilesDir & "\AutoIt3\SciTE\SciTe.exe")
oÝ÷ ØÆ¢ú趦jëh×6
#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.2.4.9
    Author:         Greenhorn
    
    Script Function:
    Auto(It)-Updater v1.0.3
    
#ce ----------------------------------------------------------------------------
#Region AutoIt3Wrapper directives section
#AutoIt3Wrapper_icon=E:\AutoIt Projekte\Icons\au3.ico
#AutoIt3Wrapper_res_comment=Automatischer Updater für AutoIt
#AutoIt3Wrapper_res_description=Updater für AutoIt
#AutoIt3Wrapper_res_fileversion=1.0.2.0
#EndRegion


#NoTrayIcon
#include <INet.au3>
#include <String.au3>
ShellExecute(@ProgramFilesDir & "\AutoIt3\SciTE\SciTE.exe")

Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)

HotKeySet("{LCTRL}+{UP}", "_UpdateCheck")    ; Left Control + Arrow Up drücken um auf Updates zu prüfen
Dim $CurrentFileVersion
Dim $NewFileVersion

Do    ; Update Automatik - Einmal pro Stunde
    If @MIN = 59 Then _UpdateCheck()        
    Sleep(30000)
Until ProcessExists("SciTE.exe") = 0
Exit

Func _UpdateCheck()
    $Ping = Ping("www.AutoItScript.com", 250)
        If $Ping Then
            $CurrentFileVersion = FileGetVersion(@ProgramFilesDir & "\AutoIt3\AutoIt3.exe")
            $Source = _INetGetSource("http://www.autoitscript.com/autoit3/downloads.php")
            If StringInStr($Source, "autoit-v" & $CurrentFileVersion & "-setup.exe") Then
                Sleep(60000)
            Else
                $NewFileVersion = _StringBetween($Source, "autoit-v", "-setup.exe")
                $WhatToDo = MsgBox(68, "AutoIt Updates", "Es sind Updates vorhanden!" & @CRLF & "" & @CRLF &  "Installierte Version: AutoIT v" & $CurrentFileVersion  & @CRLF & "" & @CRLF &  "Verfügbare Version:   AutoIT v" & $NewFileVersion[0] & @CRLF & "" & @CRLF &  "Updates herunterladen ?")
                Select
                    Case $WhatToDo = 6    ; Ja, Updates herunterladen
                        InetGet("http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v" & $NewFileVersion[0] & "-setup.exe", "autoit-v" & $NewFileVersion[0] & "-setup.exe", 1, 1)
                        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
                                ShellExecuteWait("autoit-v" & $NewFileVersion[0] & "-setup.exe", "/S")
                                MsgBox(64, "AutoIt Udates", "Updates wurden erfolgreich installiert!")
                            Case $WhatToDoNow = 7    ; Nein, Updates nicht installieren
                                Exit
                        EndSelect                        
                        Exit
                    Case $WhatToDo = 7    ; Nein, Updates nicht herunterladen
                        Exit
                EndSelect
            EndIf
        Else
            Sleep(30000)
        EndIf
EndFunc

Greetz

Greenhorn

p.s.: In the Example-Scripts Section I'm not able to post this, so I'm sorry to spam it here... :rambo:

Posted

That's what my Script is doing.

It runs SciTe, but only if you start SciTE from the Quicklaunch bar !

I hoped there is a way to start always the Updater at first which will start SciTe...

I tried to implement it in the Registry, in the Classes/shell/command, but it doesn't work.

Isn't there a way to define per Registry that the Updater should always start if SciTe is starting... ???

@OffTopic

Am I not able to edit my posts ? In case I'm fault please tell me how to edit posts here...

Anyway..., there was a Bug in the Script above, here's now the corrected form...

#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.2.4.9
    Author:         Greenhorn
    
    Script Function:
    Auto(It)-Updater v1.0.3
    
#ce ----------------------------------------------------------------------------
#Region AutoIt3Wrapper directives section
#AutoIt3Wrapper_icon=E:\AutoIt Projekte\Icons\au3.ico
#AutoIt3Wrapper_res_comment=Automatischer Updater für AutoIt
#AutoIt3Wrapper_res_description=Updater für AutoIt
#AutoIt3Wrapper_res_fileversion=1.0.2.0
#EndRegion


#NoTrayIcon
#include <INet.au3>
#include <String.au3>
ShellExecute(@ProgramFilesDir & "\AutoIt3\SciTE\SciTE.exe")

Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)

HotKeySet("{LCTRL}+{UP}", "_UpdateCheck")    ; Left Control + Arrow Up drücken um auf Updates zu prüfen
Dim $CurrentFileVersion
Dim $NewFileVersion

Do    ; Update Automatik - Einmal pro Stunde
    If @MIN = 59 Then _UpdateCheck()    
Until ProcessExists("SciTE.exe") = 0
Exit

Func _UpdateCheck()
    $Ping = Ping("www.AutoItScript.com", 250)
        If $Ping Then
            $CurrentFileVersion = FileGetVersion(@ProgramFilesDir & "\AutoIt3\AutoIt3.exe")
            ;MsgBox(64, "Dateiversion", "AutoIt Version " & $CurrentFileVersion)
            $Source = _INetGetSource("http://www.autoitscript.com/autoit3/downloads.php")
            If StringInStr($Source, "autoit-v" & $CurrentFileVersion & "-setup.exe") Then
                Sleep(60000)
            Else
                $NewFileVersion = _StringBetween($Source, "autoit-v", "-setup.exe")
                $WhatToDo = MsgBox(68, "AutoIt Updates", "Es sind Updates vorhanden!" & @CRLF & "" & @CRLF &  "Installierte Version: AutoIT v" & $CurrentFileVersion  & @CRLF & "" & @CRLF &  "Verfügbare Version:   AutoIT v" & $NewFileVersion[0] & @CRLF & "" & @CRLF &  "Updates herunterladen ?")
                Select
                    Case $WhatToDo = 6    ; Ja, Updates herunterladen
                        InetGet("http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v" & $NewFileVersion[0] & "-setup.exe", @DesktopDir & "\autoit-v" & $NewFileVersion[0] & "-setup.exe", 1, 1)
                        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
                                ShellExecuteWait(@DesktopDir & "\autoit-v" & $NewFileVersion[0] & "-setup.exe", "/S")    ; Silent Installation
                                MsgBox(64, "AutoIt Udates", "Updates wurden erfolgreich installiert!")
                            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

Thx for attention... :rolleyes:

Greetz

Greehorn

Posted

I may be totally off the wall here, just ignore me or have a good laugh if this idea is stupid:

how about, you associate au3 files with your compiled script, you right click & choose edit, windows starts your script with the au3 file as an argument, just code some extra to your script so it starts SciTE with the same argument passed..

Posted

@ BeardedBlunder

I already tried it this way but I've got the ErrorMessage by Windows which can't open the file with this Program...

Greetz

Greenhorn

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...