Jump to content

@SW_Hide does not work


Recommended Posts

Hi,

I've got some problems running this.

The installation should be completly hidden but its not...

Anyone got ideas ?

Opt('SendKeyDelay',100)
; ----------------------------------------------------------------------------
Dim $WindowTitle = 'OpenVPN 2.0_rc10-gui-1.0-rc2  Setup'
Dim $OpenVpnGui = 'openvpn-2.0_rc10-gui-1.0-rc2-install.exe'
Dim $DefInstallDir = 'C:\Program Files\OpenVpn\'
Dim $SrcFiles = 'C:\download\openvpn\'

Install_OpenVpn()


Func Install_OpenVpn()
    FileInstall('c:\download\openvpn\openvpn-2.0_rc10-gui-1.0-rc2-install.exe' ,@TempDir & '\' ,1)
    Run(@TempDir &  '\' & $OpenVpnGui,'',@SW_HIDE)
    WinWaitActive($WindowTitle)
    Sleep(500)
    WinSetState($WindowTitle,'',@SW_HIDE)
    
    If StringInStr(ControlGetText($WindowTitle,'','Static1'),'It seems the package OpenVPN (OpenVPN GUI)') Then
        ControlClick($WindowTitle,'','Button1')                         ; Continue if already installed.
    EndIf
    If StringInStr(ControlGetText($WindowTitle,'','Static2'),'OpenVPN GUI is currently running.') Then
        ControlClick($WindowTitle,'','Button1')                         ; Close Gui if running
    EndIf
    Sleep(500)                                                          ; Safety delay
    ControlClick($WindowTitle,'','Button2')                             ; Next....
    ControlClick($WindowTitle,'','Button2')                             ; Agree
    ControlSend($WindowTitle,'','SysTreeView321','{home}{down 2}{space}{down 3}{space}{down 7}{space}'); Select Install Options
    ControlClick($WindowTitle,'','Button2')                             ; Acknowledge Options
    ControlSend($WindowTitle,'','Edit1','{home}+{end}{delete}' &$DefInstallDir)                 ; Installation Directory
    ControlClick($WindowTitle,'','Button2')                             ; Proceed with Install

    $Completed = 'empty' 
; Wait for files......
    While $Completed <> 'Completed'
        $Item = ControlListView($WindowTitle,'','SysListView321','GetItemCount')
        $Completed = ControlListView($WindowTitle,'','SysListView321','GetText',$Item -1)
        Sleep(50)
    WEnd
    ControlClick($WindowTitle,'','Button2')                             ; Setup Completed
    ControlClick($WindowTitle,'','Button2')                             ; End Setup
;Wait for program to unload....
    Sleep(500)
    FileDelete(@TempDir &  '\' & $OpenVpnGui)
EndFunc

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to post
Share on other sites

Thnx now i know whats wrong...

But when i wait and then hide them, is my screen then going to flicker ?

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to post
Share on other sites

Any idea to solve that ?

Edit : Perhaps an extended _Run function that hides all windows ?

Edited by Andre
What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to post
Share on other sites

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...