TheRealMethuselah Posted July 15, 2017 Share Posted July 15, 2017 So, I'm trying to install SQL Server Express 2008 R2. I know I can use keys to install, but I'm trying to learn how to use ControlClick. Every time I run the installer, the ID of the "New Installation or add features to an existing installation." changes. I've tried various ways to get a click, but it may be that I"m missing something. Given the information in the AutoIt v3 Window Info program. How would I get the mouse to simply click that top link? Link to comment Share on other sites More sharing options...
Neutro Posted July 15, 2017 Share Posted July 15, 2017 Hi, You should use ControlClick as a last option if you can't do anything else. As it relies on GUI interaction, if someone use the computer while your script is running, it might fail. A quick google search shows that you can do a silent install of SQL 2008 with a configuration (.ini) file. Also ControlClick will sometimes not work because the GUI designed by the app you try to interact with is somewhat special. In this case you can use some screen reading tools like the FastFind (FF) UDF or the Tesseract UDF to know exactly where the mouse must click. Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
Danyfirex Posted July 16, 2017 Share Posted July 16, 2017 Hello. Try to use the ClassNN. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
TheDcoder Posted July 16, 2017 Share Posted July 16, 2017 (edited) Use Text for controlID: '[TEXT: New installation or add features existing installation]' Edited July 16, 2017 by TheDcoder EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
TheRealMethuselah Posted July 17, 2017 Author Share Posted July 17, 2017 Danyfirex - The ClassNN changes each time the .exe is ran, just like the ID. I'll try TheDcoder's suggestion, but I'm starting to feel this is a lost cause. TheDcoder 1 Link to comment Share on other sites More sharing options...
Danyfirex Posted July 17, 2017 Share Posted July 17, 2017 Please Post The AutoIt Window Information of the Static control and the SQL Server Window. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Danyfirex Posted July 17, 2017 Share Posted July 17, 2017 This Should work. #include <WinAPI.au3> Local $hWindow=WinActivate("SQL Server Installation Center") _NetControlClick($hWindow, "STATIC", 1) ;this should work for you Func _NetControlClick($hWindow, $sControlType, $IDNumber) Local $sClassName =_WinAPI_GetClassName($hWindow) Local $sApp = StringMid($sClassName, StringInStr($sClassName, ".app")) $sClassName = StringMid($sClassName, 1, StringInStr($sClassName, ".")) Return ControlClick($hWindow, "", $sClassName & $sControlType & $sApp & $IDNumber) EndFunc ;==>_NetControlClick Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Trong Posted July 17, 2017 Share Posted July 17, 2017 1 >> Installation expandcollapse popup>>>> Window <<<< Title: SQL Server Installation Center Class: WindowsForms10.Window.8.app.0.1ca0192_r14_ad1 Position: 1108, 86 Size: 800, 600 Style: 0x16CF0000 ExStyle: 0x00050100 Handle: 0x000000000005045A >>>> Control <<<< Class: WindowsForms10.Window.8.app.0.1ca0192_r14_ad1 Instance: 10 ClassnameNN: WindowsForms10.Window.8.app.0.1ca0192_r14_ad110 Name: navigation Advanced (Class): [NAME:navigation] ID: 197692 Text: navigation Position: 0, 0 Size: 238, 518 ControlClick Coords: 55, 54 Style: 0x56010000 ExStyle: 0x00010000 Handle: 0x000000000003043C >>>> Mouse <<<< Position: 1171, 170 Cursor ID: 0 Color: 0xD2D3D7 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Installation Installation New installation or add features to an existing installation. Launch a wizard to install SQL Server 2008 R2 in a non-clustered environment or to add features to an existing SQL Server 2008 R2 instance. New SQL Server failover cluster installation Launch a wizard to install a single-node SQL Server 2008 R2 failover cluster. Add node to a SQL Server failover cluster Launch a wizard to add a node to an existing SQL Server 2008 R2 failover cluster. Upgrade from SQL Server 2000, SQL Server 2005 or SQL Server 2008 Launch a wizard to upgrade SQL Server 2000, SQL Server 2005 or SQL Server 2008 to SQL Server 2008 R2. Search for product updates Search Microsoft Update for SQL Server 2008 R2 product updates. navigation >>>> Hidden Text <<<< 2 >> New installation or add features to an existing installation. expandcollapse popup>>>> Window <<<< Title: SQL Server Installation Center Class: WindowsForms10.Window.8.app.0.1ca0192_r14_ad1 Position: 769, 183 Size: 800, 600 Style: 0x16CF0000 ExStyle: 0x00050100 Handle: 0x000000000005045A >>>> Control <<<< Class: WindowsForms10.STATIC.app.0.1ca0192_r14_ad1 Instance: 1 ClassnameNN: WindowsForms10.STATIC.app.0.1ca0192_r14_ad11 Name: Advanced (Class): [CLASS:WindowsForms10.STATIC.app.0.1ca0192_r14_ad1; INSTANCE:1] ID: 132280 Text: New installation or add features to an existing installation. Position: 291, 12 Size: 311, 19 ControlClick Coords: 157, 10 Style: 0x5601000D ExStyle: 0x00000000 Handle: 0x00000000000204B8 >>>> Mouse <<<< Position: 1225, 235 Cursor ID: 0 Color: 0x80D4FF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Installation Installation New installation or add features to an existing installation. Launch a wizard to install SQL Server 2008 R2 in a non-clustered environment or to add features to an existing SQL Server 2008 R2 instance. New SQL Server failover cluster installation Launch a wizard to install a single-node SQL Server 2008 R2 failover cluster. Add node to a SQL Server failover cluster Launch a wizard to add a node to an existing SQL Server 2008 R2 failover cluster. Upgrade from SQL Server 2000, SQL Server 2005 or SQL Server 2008 Launch a wizard to upgrade SQL Server 2000, SQL Server 2005 or SQL Server 2008 to SQL Server 2008 R2. Search for product updates Search Microsoft Update for SQL Server 2008 R2 product updates. navigation >>>> Hidden Text <<<< Regards, 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