TheRealMethuselah

SQL Server Express 2008 R2

8 posts in this topic

#1 ·  Posted

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted

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.

Share this post


Link to post
Share on other sites

#3 ·  Posted

Hello. Try to use the ClassNN.

 

Saludos

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Use Text for controlID:

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

 

Edited by TheDcoder

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#5 ·  Posted

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.

 

1 person likes this

Share this post


Link to post
Share on other sites

#6 ·  Posted

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

 

Saludos

Share this post


Link to post
Share on other sites

#7 ·  Posted

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

Share this post


Link to post
Share on other sites

#8 ·  Posted

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,
 

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