Jump to content

SQL Server Express 2008 R2


Recommended Posts

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.
ZXzGYsa.jpg

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.
IbsxYqn.jpg

How would I get the mouse to simply click that top link?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Link to comment
Share on other sites

Use Text for controlID:

'[TEXT: New installation or add features existing installation]'

 

Edited 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

Please Post The AutoIt Window Information of the Static control and the SQL Server Window.

 

Saludos

Link to comment
Share on other sites

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

Link to comment
Share on other sites

1 >>  Installation

>>>> 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.

>>>> 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

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
 Share

  • Recently Browsing   0 members

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