gloriags Posted February 20, 2014 Share Posted February 20, 2014 Hi, This is my 2nd day learning AutoIt. My goal is to create an unattended software Install. I have gotten my script to run and install the product. But when I get to the final window, there is a checkbox activated to run the application. I would like to uncheck the box and select finish. The code does not seem to recognize the check box. Will you assist me in what I may be missing. I have attached the final window of the install, I have tried using the various titles of the window within the CtrlSetState function hoping it will recognize the check box. Please refer to attachment. Here is part of the code. #include <MsgBoxConstants.au3> $STATE = "CHECKED" If $STATE = "CHECKED" then GUICtrlSetState ("Launch Roadview Workstation after the installer closes.", GUI_UNCHECKED) $STATE = "UNCHECKED" EndIf Send("!f") Link to comment Share on other sites More sharing options...
Bearpocalypse Posted February 20, 2014 Share Posted February 20, 2014 Have you tried doing a silent install or using a response file? I have several auto installers that use both. gloriags 1 Link to comment Share on other sites More sharing options...
gloriags Posted February 20, 2014 Author Share Posted February 20, 2014 I haven't; I asked the vendor if a MSI file would do, but the vendor suggested going this venue. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 20, 2014 Moderators Share Posted February 20, 2014 What do you get if you use the AutoIt Window Info Tool (located in the same directory where you installed AutoIt) and hover over the checkbox? Does it show a Control ID or ClassName you can manipulate? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
gloriags Posted February 20, 2014 Author Share Posted February 20, 2014 Thank you for your response. I tried the tool and hovered over the check box. The Class, Instance, ClassnameNNM, ID, and others are blank. I have attached the screen capture. Link to comment Share on other sites More sharing options...
jdelaney Posted February 20, 2014 Share Posted February 20, 2014 (edited) This function will grab/set the state of the checkbox (click it for the helpfile): ControlCommand Try running this, while the window is open, and active (added a sleep to make sure you activate the window first), and send back the output: #include <WinAPI.au3> Sleep(5000) Var_GetAllWindowsControls2("[ACTIVE]") Func Var_GetAllWindowsControls2($hCallersWindow) ; Get all list of controls $sClassList = WinGetClassList($hCallersWindow) ; Create array $aClassList = StringSplit($sClassList, @CRLF, 2) ; Sort array _ArraySort($aClassList) _ArrayDelete($aClassList, 0) ; Loop Local $iCurrentClass = "", $iCurrentCount = 1, $iTotalCounter = 1 For $i = 0 To UBound($aClassList) - 1 If $aClassList[$i] = $iCurrentClass Then $iCurrentCount += 1 Else $iCurrentClass = $aClassList[$i] $iCurrentCount = 1 EndIf $hControl = ControlGetHandle($hCallersWindow, "", "[CLASSNN:" & $iCurrentClass & $iCurrentCount & "]") $text = StringRegExpReplace(ControlGetText($hCallersWindow, "", $hControl), "[\n\r]", "{@CRLF}") $aPos = ControlGetPos($hCallersWindow, "", $hControl) $sControlID = _WinAPI_GetDlgCtrlID($hControl) If IsArray($aPos) Then ConsoleWrite("Func=[Var_GetAllWindowsControls]: ControlCounter=[" & StringFormat("%3s", $iTotalCounter) & "] ControlID=[" & StringFormat("%5s", $sControlID) & "] Handle=[" & StringFormat("%10s", $hControl) & "] ClassNN=[" & StringFormat("%19s", $iCurrentClass & $iCurrentCount) & "] XPos=[" & StringFormat("%4s", $aPos[0]) & "] YPos=[" & StringFormat("%4s", $aPos[1]) & "] Width=[" & StringFormat("%4s", $aPos[2]) & "] Height=[" & StringFormat("%4s", $aPos[3]) & "] Text=[" & $text & "]." & @CRLF) Else ConsoleWrite("Func=[Var_GetAllWindowsControls]: ControlCounter=[" & StringFormat("%3s", $iTotalCounter) & "] ControlID=[" & StringFormat("%5s", $sControlID) & "] Handle=[" & StringFormat("%10s", $hControl) & "] ClassNN=[" & StringFormat("%19s", $iCurrentClass & $iCurrentCount) & "] XPos=[winclosed] YPos=[winclosed] Width=[winclosed] Height=[winclosed] Text=[" & $text & "]." & @CRLF) EndIf If Not WinExists($hCallersWindow) Then ExitLoop $iTotalCounter += 1 Next EndFunc If it retruns nothing, then you will have to use pixel searches, or something...is this a java applet? Edited February 20, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 20, 2014 Moderators Share Posted February 20, 2014 It must be, as it is of the SunAwtFrame class. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
gloriags Posted February 21, 2014 Author Share Posted February 21, 2014 FYI - I tried compiling the script above, it got quarantined by the anti-virus utility used in our department. It got catergorized as MALWARE32. The AutoIt executables also got quarantined and removed. Link to comment Share on other sites More sharing options...
jdelaney Posted February 21, 2014 Share Posted February 21, 2014 (edited) Why would you need to compile it to run it? Also, it won't help. That's a painted gui. There are hooks available to get in, and manipulate controls on java, but it takes a lot of work...and time. Edited February 21, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
abberration Posted February 21, 2014 Share Posted February 21, 2014 FYI - I tried compiling the script above, it got quarantined by the anti-virus utility used in our department. It got catergorized as MALWARE32. The AutoIt executables also got quarantined and removed. Try "Compile with Options" and uncheck the UPX option. Easy MP3 | Software Installer | Password Manager 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