Sign in to follow this  
Followers 0
gloriags

Creating an Unattended Software Install - how do I get my script recognize the GUI_UNCHECK

10 posts in this topic

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"post-84876-0-32274300-1392911576_thumb.j)

Share this post


Link to post
Share on other sites

Have you tried doing a silent install or using a response file? I have several auto installers that use both.

1 person likes this

Share this post


Link to post
Share on other sites

I haven't;  I asked the vendor if a MSI file would do, but the vendor suggested going this venue.

Share this post


Link to post
Share on other sites

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?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

post-84876-0-11114500-1392919997_thumb.jThank 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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

It must be, as it is of the SunAwtFrame class.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

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.


RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


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
Sign in to follow this  
Followers 0