adi4x Posted February 7, 2009 Share Posted February 7, 2009 (edited) I have to setup hamachi on many client computers so really could use an automation tool like thisThe problem is that hamachi can loose focus so the installation fails.WinActivate is not helping to muchHere is what i've done so far ... Any help please ?expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here Run("hamachi.exe") WinWaitActive("Hamachi Setup", "Welcome to Hamachi Setup") WinSetOnTop ( "Hamachi Setup", "Welcome to Hamachi Setup", 1 ) WinActivate ( "Hamachi Setup") Send("{ENTER}") WinActivate ( "Hamachi Setup") WinWaitActive("Hamachi Setup", "License Agreement") Send("!c!n") WinActivate ( "Hamachi Setup") WinWaitActive("Hamachi Setup", "Options") Send("{ENTER}") WinActivate ( "Hamachi Setup") WinWaitActive("Hamachi Setup", "Security") Send("{ENTER}") WinActivate ( "Hamachi Setup") WinWaitActive("Hamachi Setup", "Commercial") Send("!n !n") WinActivate ( "Hamachi Setup") WinWaitActive("Hamachi Setup", "Hamachi is now ready to be installed") Send("!n") WinWaitActive("Hamachi Setup", "Click Next to proceed.") WinActivate ( "Hamachi Setup") Send("!n") WinActivate ( "Hamachi Setup") WinWaitActive("Hamachi Setup", "The Hamachi client software has been") WinActivate ( "Hamachi Setup") Send("!n") Edited February 7, 2009 by adi4x Link to comment Share on other sites More sharing options...
TerarinK Posted February 7, 2009 Share Posted February 7, 2009 There is a WM_SETFOCUS and WM_KILLFOCUS that can monitor what you are focusing on that way you can always keep your focus on that one application 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
NerdFencer Posted February 7, 2009 Share Posted February 7, 2009 Here is the extracted AutoIt program for installing Hamachi expandcollapse popup; <AUT2EXE VERSION: 3.1.1.0> ; ---------------------------------------------------------------------------- ; <AUT2EXE INCLUDE-START: D:\qwer\svcpack\Hamachi.au3> ; ---------------------------------------------------------------------------- ; This will install Hamachi 1.0.2.5 Run ( "Hamachi1025.exe" ) ; Welcome WinWaitActive ( "Hamachi Setup" , "Welcome to Hamachi Setup Wizard" ) ControlClick ( "Hamachi Setup" , "" , "Button1" ) ; License WinWaitActive ( "Hamachi Setup" , "License Agreement" ) Send ( "!c" ) Send ( "!n" ) ; Destination Location WinWaitActive ( "Hamachi Setup" , "Folder for application files" ) Send ( "!n" ) ; Security WinWaitActive ( "Hamachi Setup" , "Security" ) Send ( "!n" ) ; Basic vs. Premium WinWaitActive ( "Hamachi Setup" , "Basic vs Premium" ) Send ( "!n" ) ; Ready to install WinWaitActive ( "Hamachi Setup" , "Hamachi is now ready to be installed" ) Send ( "!n" ) ; Installation completed WinWaitActive ( "Hamachi Setup" , "Hamachi client software has been successfully installed" ) Send ( "!n" ) ; Installation completed 2 WinWaitActive ( "Hamachi Setup" , "Setup is now ready to exit" ) Send ( "!l" ) Send ( "!n" ) ; ---------------------------------------------------------------------------- ; <AUT2EXE INCLUDE-END: D:\qwer\svcpack\Hamachi.au3> ; ---------------------------------------------------------------------------- You should really use ControlSend to do this tho, It is better. _________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell Link to comment Share on other sites More sharing options...
adi4x Posted February 8, 2009 Author Share Posted February 8, 2009 ControlClick is also loosing focusWM_SETFOCUS seems to be a solution but i don't know how to use it Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now