theocoza Posted September 30, 2015 Share Posted September 30, 2015 (edited) Digging out some old posts...Im new to autoit and im trying to automatize my softwares installation on new PC.this code is not working:#include <IE.au3> #RequireAdmin ; Chrome download $o_IE = _IECreate () _IENavigate ($o_IE, "https://dl.google.com/update2/1.3.28.15/GoogleInstaller_fr.application?appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7BC76EAF54-CD3B-5F21-FFDC-91E978A9E77F%7D%26lang%3Dfr%26browser%3D2%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26installdataindex%3Ddefaultbrowser") ; Chrome installation WinWaitActive("Fichier ouvert - Avertissement de sécurité") Send("{LEFT}{ENTER}") _IEQuit($o_IE)this code is working:#include <IE.au3> #RequireAdmin ; téléchargement de Chrome $o_IE = _IECreate () _IENavigate ($o_IE, "https://dl.google.com/update2/1.3.28.15/GoogleInstaller_fr.application?appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7BC76EAF54-CD3B-5F21-FFDC-91E978A9E77F%7D%26lang%3Dfr%26browser%3D2%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26installdataindex%3Ddefaultbrowser") ; installation de Chrome WinWaitActive("Fichier ouvert - Avertissement de sécurité") Send("{LEFT}") WinWaitActive("Fichier ouvert - Avertissement de sécurité") Send("{ENTER}") _IEQuit($o_IE)This second solution is not clean and i'd prefer using the first one, if someone finds out why it is not working.I tried other keystrokes and it seems I only have problems with {ENTER}. Edited September 30, 2015 by Melba23 Changed title Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 30, 2015 Moderators Share Posted September 30, 2015 theocoza,Welcome to the AutoIt forums.Please do not "dig up old posts" - particularly when they have only a tenuous link to your problem - just start a new thread as I have now done for you. We ask you to do this for two main reasons:The language advances and the functionality might well be included in core or UDF code by nowThe changes in language syntax mean that it is likely that code from more than a couple of years ago may well not run under the current release interpreter without significant modification.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
theocoza Posted September 30, 2015 Author Share Posted September 30, 2015 (edited) Ok, thanks for creating new thread for me (though i cant edit it now).just for background info, i tried what had been previously said in the old thread:; installation de Chrome WinWaitActive("Fichier ouvert - Avertissement de sécurité") Send("{LEFT}") Sleep(100) Send("{ENTER}") _IEQuit($o_IE)It's not wokring neither, i really have to call WinWaitActive a second time just to send {ENTER} keystroke. Edited September 30, 2015 by theocoza Link to comment Share on other sites More sharing options...
jguinch Posted September 30, 2015 Share Posted September 30, 2015 Instead of using _IECreate, you could download the installer with InetGet and then launch it after ?#RequireAdmin InetGet("https://dl.google.com/update2/1.3.28.15/GoogleInstaller_fr.application?appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7BC76EAF54-CD3B-5F21-FFDC-91E978A9E77F%7D%26lang%3Dfr%26browser%3D2%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26installdataindex%3Ddefaultbrowser", "GoogleInstaller_fr.application") ShellExecute("GoogleInstaller_fr.application") Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
theocoza Posted October 1, 2015 Author Share Posted October 1, 2015 Thx for answer.I didnt know this function, its working great and makes the code more readable.Any idea why i have problems with send("{LEFT}{ENTER}")?My first thought was it's sending its commands so fast, the application may not have the time to apply all the keystrokes. But send("{TAB}{TAB}{TAB}{TAB}{ENTER}") is sending the correct amount of {TAB}, it only has a problem on {ENTER}. And using send("{LEFT}") -> sleep(1000) -> send("{ENTER}") is not working neither...Why do I need to call WinWaitActive a second time just to send("{ENTER}")? Link to comment Share on other sites More sharing options...
jguinch Posted October 1, 2015 Share Posted October 1, 2015 I tried to download an run the GoogleInstaller_fr.application, but I have an error "Impossible de télécharger l'application", so I cannot get the same window than you.Did you try do use the Window Info Tool, to identify the controls ? Maybe you could use ControlClick (it's more reliable than Send).A+ (et boujour de Franche-Comté !) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF 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