Earthshine Posted August 5, 2019 Share Posted August 5, 2019 get the two required udfs and you should be able to do the entire install My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 (edited) 12 hours ago, Earthshine said: get the two required udfs and you should be able to do the entire install Hi again, I'm gonna have a lot of dummy questions... I hope it won't bother you too much I'm trying to understand what I need to do. 1) I have added the Setup.exe at the top of your script. Is it the way I should do ? #AutoIt3Wrapper_Compression=3 #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_Add_Constants=n #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Run ("Setup.exe","C:\Tools\SpeechMagic6\WsSetup\French") #RequireAdmin 2) On this window (the first one that opens when I launch setup.exe) : What would be the $text I'm looking for ? I've tried Avertissement or OK but it doesn't change anything. Is it "Il n'y a aucun.." ? Const $text = "Put your official text you are looking for here...." Here's the log : 8\06\2019 07:57:24 | MININT-M8KE3UD | Info | Begin Install() 08\06\2019 07:57:24 | MININT-M8KE3UD | Info | _checkClickCtrl():Begin 08\06\2019 07:57:24 | MININT-M8KE3UD | Info | Searching for Formclass: [Class:#32770] 08\06\2019 07:57:24 | MININT-M8KE3UD | Info | Searching for Text: OK 08\06\2019 07:57:24 | MININT-M8KE3UD | Info | Searching for Control: [CLASS:Button; INSTANCE:1] 08\06\2019 07:57:24 | MININT-M8KE3UD | Info | Searching for Ctrl Txt: OK 08\06\2019 07:57:24 | MININT-M8KE3UD | Info | Timeout: 0 08\06\2019 07:57:24 | MININT-M8KE3UD | Info | Time Delay (after click): 0 08\06\2019 08:06:48 | MININT-M8KE3UD | Info | Begin Install() 08\06\2019 08:06:48 | MININT-M8KE3UD | Info | _checkClickCtrl():Begin 08\06\2019 08:06:48 | MININT-M8KE3UD | Info | Searching for Formclass: [Class:#32770] 08\06\2019 08:06:48 | MININT-M8KE3UD | Info | Searching for Text: OK 08\06\2019 08:06:48 | MININT-M8KE3UD | Info | Searching for Control: [CLASS:Button; INSTANCE:1] 08\06\2019 08:06:48 | MININT-M8KE3UD | Info | Searching for Ctrl Txt: OK 08\06\2019 08:06:48 | MININT-M8KE3UD | Info | Timeout: 0 08\06\2019 08:06:48 | MININT-M8KE3UD | Info | Time Delay (after click): 0 Edited August 6, 2019 by Tof006 Link to comment Share on other sites More sharing options...
Earthshine Posted August 6, 2019 Share Posted August 6, 2019 (edited) use the Avertissment for the text, the OK is the button, which is defined. what is the AutoIt Info tool say about that button, please. Edited August 6, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 (edited) Hi, Here's what I've been able to do so far : expandcollapse popup#AutoIt3Wrapper_Compression=3 #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_Add_Constants=n #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #RequireAdmin #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include 'log4a.au3' #include 'WaitForControls.au3' Const $TD_BTN_NEXT = '&Suivant >' Const $TD_BTN_INSTALL = '&Install' Const $TD_BTN_INSTALL2 = 'Install' Const $TD_BTN_FINISH = '&Finish' Const $TD_BTN_CANCEL = 'Cancel' Const $TD_BTN_SELECTALL = 'Sélectionner &tout' Const $TD_BTN_SPEECHMIKE = 'Speech&Mike Pro ou SpeechMike' Const $TD_BTN_IAGREE = "I &accept the terms in the license agreement" Const $TD_BTN_ALTFINISH = '&Finish' Const $TD_BTN_ALLOW_ACCESS = '&Allow access' Const $TD_BTN_REMOVE = '&Remove' Const $TD_BTN_YES = '&Yes' Const $TD_BTN_OK = 'OK' Const $TD_BTN_TYPICAL = '&Typical' Const $TD_EDIT_DATA = '99999' Const $TD_TREE_NAME = 'Tree1' Const $textWarning = "Avertissement" Const $textInstallShield = "InstallShield Wizard" Const $stdClass = '[Class:#32770]' Const $button1 = "[CLASS:Button; INSTANCE:1]" Const $button2 = "[CLASS:Button; INSTANCE:2]" Const $button3 = "[CLASS:Button; INSTANCE:3]" Const $button4 = "[CLASS:Button; INSTANCE:4]" Const $button5 = "[CLASS:Button; INSTANCE:5]" Const $button6 = "[CLASS:Button; INSTANCE:6]" Const $Edit1 = "[CLASS:Edit; INSTANCE:1]" #Region ;**** Logging This sections sets up logging. If you compile it, it creates a nice text log file with the script name and a .log at the end. **** ; Enable logging and don't write to stderr _log4a_SetEnable() ; Write to stderr, set min level to warn, customize message format _log4a_SetErrorStream() _log4a_SetCompiledOutput($LOG4A_OUTPUT_FILE) _log4a_SetMinLevel($LOG4A_LEVEL_DEBUG) ; If @compiled Then _log4a_SetMinLevel($LOG4A_LEVEL_WARN) ; Change the min level if the script is compiled _log4a_SetFormat("${date} | ${host} | ${level} | ${message}") #EndRegion ;**** Logging **** Func Install() Run("C:\Tools\SpeechMagic6\WsSetup\French\Setup.exe") _log4a_Info('Begin Install()') _checkClickCtrl($stdClass, $textWarning, $button1, $TD_BTN_OK, 0) _checkClickCtrl($stdClass, $textInstallShield, $button1, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button1, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button2, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button2, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button1, $TD_BTN_SELECTALL, 0) _log4a_Info('End Install()') EndFunc ;==>Install Install() I'm stuck here : Here's the sequence : Here, it looks for Sélectionner &tout but this button is on the next screen... It doesn't seem to accept step 4 I can add 2 or 3 _checkClickCtrl($stdClass, $textInstallShield, $button2, $TD_BTN_NEXT, 0) it will be stuck on this window. Question : what does the 0 stand for at the end this command ? Edited August 6, 2019 by Tof006 Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 More over, when I compile this small script and run the exe in a SYSTEM command prompt... it doesn't click on anything My first problem is then still here.. Link to comment Share on other sites More sharing options...
Earthshine Posted August 6, 2019 Share Posted August 6, 2019 the zero tells it to wait forever. you can supply a timeout if you chose. My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 There's an odd thing : When launching C:\WINDOWS\system32>d:\PsExec.exe -s -i c:\Tools\SpeechMagic6\WsSetup\French\SpeechMagic6-2.exe it seems to work Earthshine 1 Link to comment Share on other sites More sharing options...
Earthshine Posted August 6, 2019 Share Posted August 6, 2019 (edited) at least you solved it. i am still wondering why it doesn't find that 4th Next button. Edited August 6, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 (edited) 7 minutes ago, Earthshine said: at least you solved it. i am still wondering why it doesn't find that 4th Next button. But as I told you, this command line has been able to find the 4th button ... and the Sélectionnez &tout button EDIT : I don't understand how this works but ... if I stop the installation and start it again : it doesn't work anymore : Edited August 6, 2019 by Tof006 Link to comment Share on other sites More sharing options...
Earthshine Posted August 6, 2019 Share Posted August 6, 2019 without being able to test it, I can't say My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 OK, I'm gonna take all buttons and try to create a full script then I'll try it on a brand new VM I have one question but I cannot post any screenshot anymore because I don't have anymore space available... Can I PM it ? Link to comment Share on other sites More sharing options...
Earthshine Posted August 6, 2019 Share Posted August 6, 2019 sure. you might want to go delete all those images you uploaded. get your space back My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 (edited) That would be unfortunate... I'll probably do it once it's over and do a recap for others who would be interested in what I've been learning with you EDIT : even in PM I cannot post. I'm gonna delete some of them Edited August 6, 2019 by Tof006 Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 (edited) OK back on track Here's my question : how do I fill this box ? I assume the STD_EDIT_DATA is the one I should use but I don't know what command to pass here.... Edited August 6, 2019 by Tof006 Link to comment Share on other sites More sharing options...
Earthshine Posted August 6, 2019 Share Posted August 6, 2019 you can use ControlSetText command to do so My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 (edited) Sorry but it's a bit lite for my level of knowledge... Can you provide me with an example please ? Edited August 6, 2019 by Tof006 Link to comment Share on other sites More sharing options...
Earthshine Posted August 6, 2019 Share Posted August 6, 2019 Just now, Tof006 said: Sorry but it's a bit lite for my level of knowledge... Can you provide me with an example please ? just look it up in the Help file, from the AutoIt editor, Scite, just hit F1 and search for ControlSetText example from the help file #include <MsgBoxConstants.au3> Example() Func Example() ; Run Notepad Run("notepad.exe") ; Wait 10 seconds for the Notepad window to appear. Local $hWnd = WinWait("[CLASS:Notepad]", "", 10) ; Set the edit control in Notepad with some text. The handle returned by WinWait is used for the "title" parameter of ControlSetText. ControlSetText($hWnd, "", "Edit1", "This is some text") ; Retrieve the text of the edit control in Notepad. The handle returned by WinWait is used for the "title" parameter of ControlGetText. Local $sText = ControlGetText($hWnd, "", "Edit1") ; Display the text of the edit control. MsgBox($MB_SYSTEMMODAL, "", "The text in Edit1 is: " & $sText) ; Close the Notepad window using the handle returned by WinWait. WinClose($hWnd) EndFunc ;==>Example My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 (edited) Sorry, I must be a bit too dum to use this here.. That code doesn't do anything : expandcollapse popupConst $TD_BTN_NEXT = '&Suivant >' ;Const $TD_BTN_INSTALL = '&Install' ;Const $TD_BTN_INSTALL2 = 'Install' Const $TD_BTN_FINISH = '&Finish' Const $TD_BTN_CANCEL = 'Annuler' Const $TD_BTN_SELECTALL = 'Sélectionner &tout' Const $TD_BTN_SPEECHMIKE = 'Speech&Mike Pro ou SpeechMike' Const $TD_BTN_IAGREE = "I &accept the terms in the license agreement" Const $TD_BTN_ALTFINISH = '&Finish' Const $TD_BTN_ALLOW_ACCESS = '&Allow access' Const $TD_BTN_REMOVE = '&Remove' Const $TD_BTN_YES = '&Yes' Const $TD_BTN_OK = 'OK' Const $TD_BTN_TYPICAL = '&Typical' Const $TD_EDIT_DATA = '99999' Const $TD_TREE_NAME = 'Tree1' Const $textWarning = "Avertissement" Const $textInstallShield = "InstallShield Wizard" Const $stdClass = '[Class:#32770]' Const $button1 = "[CLASS:Button; INSTANCE:1]" Const $button2 = "[CLASS:Button; INSTANCE:2]" Const $button3 = "[CLASS:Button; INSTANCE:3]" Const $button4 = "[CLASS:Button; INSTANCE:4]" Const $button5 = "[CLASS:Button; INSTANCE:5]" Const $button6 = "[CLASS:Button; INSTANCE:6]" Const $Edit1 = "[CLASS:Edit; INSTANCE:1]" Const $Edit2 = "[CLASS:Edit; INSTANCE:2]" Const $Edit3 = "[CLASS:Edit; INSTANCE:3]" Const $User = "xxx\xxxx" Const $Pass = "xxxx" #Region ;**** Logging This sections sets up logging. If you compile it, it creates a nice text log file with the script name and a .log at the end. **** ; Enable logging and don't write to stderr _log4a_SetEnable() ; Write to stderr, set min level to warn, customize message format _log4a_SetErrorStream() _log4a_SetCompiledOutput($LOG4A_OUTPUT_FILE) _log4a_SetMinLevel($LOG4A_LEVEL_DEBUG) ; If @compiled Then _log4a_SetMinLevel($LOG4A_LEVEL_WARN) ; Change the min level if the script is compiled _log4a_SetFormat("${date} | ${host} | ${level} | ${message}") #EndRegion ;**** Logging **** Func Install() Run("C:\Tools\SpeechMagic6\WsSetup\French\Setup.exe") _log4a_Info('Begin Install()') _checkClickCtrl($stdClass, $textWarning, $button1, $TD_BTN_OK, 0) _checkClickCtrl($stdClass, $textInstallShield, $button1, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button1, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button2, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button2, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button2, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button1, $TD_BTN_SELECTALL, 0) _checkClickCtrl($stdClass, $textInstallShield, $button4, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button1, $TD_BTN_SELECTALL, 0) _checkClickCtrl($stdClass, $textInstallShield, $button4, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button1, $TD_BTN_SPEECHMIKE, 0) _checkClickCtrl($stdClass, $textInstallShield, $button6, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button3, $TD_BTN_NEXT, 0) _checkClickCtrl($stdClass, $textInstallShield, $button2, $TD_BTN_NEXT, 0) ControlSetText($Edit1, "", "", $User) ControlSetText($Edit2, "", "", $Pass) ControlSetText($Edit3, "", "", $Pass) _checkClickCtrl($stdClass, $textInstallShield, $button2, $TD_BTN_NEXT, 0) _log4a_Info('End Install()') EndFunc ;==>Instal ControlSetText ( "title", "text", controlID, "new text" [, flag = 0] ) Parameters title The title/hWnd/class of the window to access. See Title special definition. text The text of the window to access. See Text special definition. controlID The control to interact with. See Controls. new text The new text to be set into the control. flag [optional] when different from 0 (default) will force the target window to be redrawn. To my understanding, I just need : - title = "[CLASS:Edit; INSTANCE:1]" =$Edit1 - text = no text in my case - ControlID = .... would be again the $Edit1 to my understanding - new text = $User I've tried with ControlID = "" or $Edit1 but it doesn't change anything. Thanks for your help Edited August 6, 2019 by Tof006 Link to comment Share on other sites More sharing options...
Earthshine Posted August 6, 2019 Share Posted August 6, 2019 (edited) ControlSetText($Edit1, "", "Edit1", $User) ControlSetText($Edit2, "", "Edit2", $Pass) Edited August 6, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Tof006 Posted August 6, 2019 Author Share Posted August 6, 2019 This doesn't work. I'm gonna give up but I really want to thank you for your help and advises. I'll stay in my ignorance and I hate that but I have lost of other things to do and cannot waste 2 more days to understand why this doesn't work. I already have wasted enough time on this crappy software. Maybe later this month I'll try again. See you and thanks again Earthshine 1 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