Jump to content

ControlClick failed when trying to automate embedded QuickTime installer inside another installer


Recommended Posts

Hi All,
I'm working on an automation for a installer that has QuickTime installer embedded. I am able to automate the first installer. However, with the embedded QuickTime installer, after the QuickTime installer window pops up, I cannot click on any of the buttons non closing the QuickTime installer. I managed to get the handle of the QuickTime installer and it returns 1 when I click on the Next button (but the GUI does not go to the next page and the installation will not be completed). I have tried many ways including WinWait, WinActivate, WinWaitActive, and using Send, ControlSend, also using Class to identify the button etc... but nothing works... Any ideas of what's the problem might be? Below are my code and output.
Thanks heaps!
==== Code ====

Func install1()
    Dim $launchInstaller = Run($installerPath)
    If $launchInstaller <> 0 Then
                ConsoleWrite("Installer found")
        Local $install1handle = WinWait($title, "", "180000")
        ; Select Agree checkbox
        ControlClick($install1handle, "", $agreeCheckBoxText)
        ; Click on Install button
        ControlClick($install1handle, "", $installButtonText)
        ; Check if QuickTime installer pops up
        $quickTimeHandle = WinWait($quicktimeInstallWindowTitle, "Welcome", "90000")
        if quickTimeHandle <> 0 Then
            ConsoleWrite(" << QuickTime installation starts here... >> " & @LF)
            $install1close = WinClose($install1handle)
            $install1close = WinClose($install1handle)

        if $install1close = 1 Then
            ConsoleWrite("Installation is completed")
            ConsoleWrite("Installation is not completed")
EndFunc ;==>install1

Func QuickTimeInstallation($handle)
    ; Click the Next button
    $quickTimeNext = ControlClick($handle, "Welcome", $quicktimeNextButtonText)
    ConsoleWrite(" << $quickTimeNext is clicked: >> " & $quickTimeNext & @LF)
    $licWindow = WinWaitActive($handle, "License Agreement")
    ConsoleWrite(" << $licWindow is shown: >> " & $licWindow & @LF)
    ; Click the Yes button on License page
    $quickTimeYes = ControlClick($licWindow, "License Agreement", $quicktimeLicenseYesButtonText)
    ConsoleWrite(" << $quickTimeYes is clicked: >> " & $quickTimeYes & @LF)
    $FolderWinddow = WinWaitActive($handle, "Destination Folder")
    ConsoleWrite(" << $FolderWinddow is shown: >> " & $FolderWinddow & @LF)
    ; Click the Typical button for type of Installation
    ; Click the Install button on Destination Folder page
    $quickTimeInstall = ControlClick($handle, "Destination Folder", $installButtonText)
    ConsoleWrite(" << $quickTimeInstall is clicked: >> " & $quickTimeInstall & @LF)
    ; Click the Finish button on the installer
    $completeWindow = WinWaitActive($handle, "QuickTime Installer Completed")
    ConsoleWrite(" << $completeWindow is shown: >> " & $completeWindow & @LF)
    $quickTimeFinish = ControlClick($completeWindow, "QuickTime Installer Completed", $quicktimeFinishButtonText)
    ConsoleWrite(" << $quickTimeFinish is shown: >> " & $quickTimeFinish & @LF)
    ; Close QuickTime installer
    $quickTimeClose = WinClose($handle)
    ConsoleWrite(" << $quickTimeClose is shown: >> " & $quickTimeClose & @LF)
    ConsoleWrite(" << QuickTime installation is completed >> " & @LF)
EndFunc ;==>QuickTime

==== Output ====

>Running:(\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\user1\Desktop\install.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Installer found
 << The Agree checkbox is not checked when the installer starts up >> 0
 << The Install button is disabled before the Agree checkbox is checked >> 0
 << The Install button is enabled after the Agree checkbox is checked >> 1
 << The Install button is clicked >> 1
 << QuickTime installation starts here... >> 1
 << $quickTimeNext is clicked: >> 1
 << $licWindow is shown: >> 0x0004046A
 << $quickTimeYes is clicked: >> 0
 << $FolderWinddow is shown: >> 0x0004046A
 << $quickTimeInstall is clicked: >> 0
 << $completeWindow is shown: >> 0x0004046A
 << $quickTimeFinish is shown: >> 0
 << $quickTimeClose is shown: >> 1
 << QuickTime installation is completed >> 
Installation is completed+>11:36:31 AutoIt3.exe ended.rc:0
+>11:36:31 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 54.74


Link to comment
Share on other sites

  • Moderators

What is the product, and does it support command line switches? It is usually much easier to script an install silently rather than trying to manipulate the GUI, especially if it has embedded third party products in it.

"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

Thanks JLogan3o13. The reason to use the GUI is that we try to mimic how the user install our software using the installer as much as possible, as we are automating the installer testing at the moment...

I've also tried that once we got the handle of QuickTime installer, it can retrieve the correct title of the QuickTime installer... However, it still stays on the Welcome page after sending the "click on Next button" command.

Link to comment
Share on other sites

  • 2 weeks later...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...