AutoIT Installer für OpenVPN

  • Hallo,

    da es für das Programm OpenVPN keinen silent Modus gibt hoffe ich über ein AutoIt-Script eine automatische Installationsroutine erstellen zu können. Im Netz habe ich sonst leider auch nichts gefunden.

    Grundsätzlich läuft die installationsroutine auch wunderbar durch. Allerdings möchte OpenVPN einen Treiber installieren und fragt die Genehmigung über den Windowsdialog "Windows-Sicherheit" ab. Bislang ist es mir leider nicht gelungen das entsprechende Fenster via AutoIT "einzufangen" und entsprechend zu bedienen. Das Installationssystem ist Microsoft Windows 7 64-Bit.


    [autoit]

    ; OpenVPN client setup v1
    ; Need to see if OpenVPN installed - Uninstall if already installed.
    dim $ver = "2.2.2"
    run("openvpn-2.2.2-install.exe","",@SW_MINIMIZE)
    WinWait("OpenVPN 2.2.2 Setup", "Welcome to the OpenVPN 2.2.2 Setup Wizard", 15)
    ControlSend("OpenVPN "&$ver&" Setup","Welcome to the OpenVPN","[CLASS:Button; INSTANCE:2]","!n")
    ControlSend("OpenVPN "&$ver&" Setup","Press Page Down to see the rest of the agreement.","[CLASS:Button; INSTANCE:2]","!a")
    sleep(500)
    ControlSend("OpenVPN "&$ver&" Setup","Choose Components","[CLASS:Button; INSTANCE:2]","!n")
    sleep(500)
    ;; Uncomment this to actually install!
    ControlSend("OpenVPN "&$ver&" Setup","Choose Install Location","[CLASS:Button; INSTANCE:2]","!i")
    ; That installs OpenVPN as default (all options). Need to remove start menu folders and desktop icons. Also, add a GUI!
    WinSetState("OpenVPN "&$ver&" Setup","",@SW_RESTORE);To show install progress, if desired...
    dim $windowxp = 0
    dim $window7 = 0
    Do
    $windowxp = WinExists("Windows-Sicherheit","TAP-Win32 Provider V9 Netzwerkadapter")
    $window7 = WinExists("OpenVPN "&$ver&" Setup","Installation Complete")
    Until $window7 = 1 Or $windowxp = 1
    if $windowxp = 1 Then
    ;Doesn't always come up - Find a workaround! Loop maybe???
    WinWait("Windows-Sicherheit","TAP-Win32 Provider V9 Netzwerkadapter")
    dim $ret = ControlSend("Windows-Sicherheit","TAP-Win32 Provider V9 Netzwerkadapter","[CLASS:Button; INSTANCE:1]","{SPACE}")
    EndIf
    ControlSend("OpenVPN "&$ver&" Setup","Installation Complete","[CLASS:Button; INSTANCE:2]","!n")
    ; Need to uncheck (if checked) the View Readme radio box...
    WinActivate("OpenVPN "&$ver&" Setup","Completing the OpenVPN")
    ControlCommand("OpenVPN "&$ver&" Setup","Completing the OpenVPN","[CLASS:Button; INSTANCE:4]","UnCheck","")
    ControlSend("OpenVPN "&$ver&" Setup","Completing the OpenVPN","[CLASS:Button; INSTANCE:2]","!f")

    [/autoit]

    Schön wäre es, wenn mir jemand den Quellcodebereich

    [autoit]

    dim $windowxp = 0
    dim $window7 = 0
    Do
    $windowxp = WinExists("Windows-Sicherheit","TAP-Win32 Provider V9 Netzwerkadapter")
    $window7 = WinExists("OpenVPN "&$ver&" Setup","Installation Complete")
    Until $window7 = 1 Or $windowxp = 1
    if $windowxp = 1 Then
    ;Doesn't always come up - Find a workaround! Loop maybe???
    WinWait("Windows-Sicherheit","TAP-Win32 Provider V9 Netzwerkadapter")
    dim $ret = ControlSend("Windows-Sicherheit","TAP-Win32 Provider V9 Netzwerkadapter","[CLASS:Button; INSTANCE:1]","{SPACE}")
    EndIf

    [/autoit]

    erklären könnte. Diesen habe ich in einem anderen Script im Netz gefunden. Windows XP möchte ich überhaupt nicht betrachten. Das "Windows-Sicherheits"-Fenster wird vom Script "komplett ignoriert".

    Über eure Hilfe freue ich mich sehr und sage nun jetzt Danke!