Jump to content

Autoit Script


Recommended Posts

Hi all i have made a autoit script to run a program that has no silent switchs. problem is it is very much dependant on screen postition so when it installing if the screen is slightly different postition it fails i dnt know if there a way to remove teh depndancy on teh screen postition but if there is here is the code

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Run('Y:\apps\digiguide\digiguide.exe')
WinWait("DigiGuide Setup - Terms and Conditions","")
If Not WinActive("DigiGuide Setup - Terms and Conditions","") Then WinActivate("DigiGuide Setup - Terms and Conditions","")
WinWaitActive("DigiGuide Setup - Terms and Conditions","")
MouseMove(350,341)
MouseDown("left")
MouseUp("left")
WinWait("DigiGuide Setup - Destination","")
If Not WinActive("DigiGuide Setup - Destination","") Then WinActivate("DigiGuide Setup - Destination","")
WinWaitActive("DigiGuide Setup - Destination","")
MouseDown("left")
MouseUp("left")
WinWait("DigiGuide Setup Wizard","")
If Not WinActive("DigiGuide Setup Wizard","") Then WinActivate("DigiGuide Setup Wizard","")
WinWaitActive("DigiGuide Setup Wizard","")
MouseMove(367,329)
MouseDown("left")
MouseUp("left")

the program is digiguide so if anyone has got something workign for this that would do fine to

Link to comment
Share on other sites


You should run it with @SW_HIDE flag, which hides installers window. Also, ControlClick () is way more better. Take a look in the help file or provide me with the installer and i'll write a script :)

Link to comment
Share on other sites

You should run it with @SW_HIDE flag, which hides installers window. Also, ControlClick () is way more better. Take a look in the help file or provide me with the installer and i'll write a script :)

unfortnally i cant provide the installe rbecuase it is register to me. but you can regster at the site www.digiguide.com and download a copy i ust need it to install when it ask for settings to i just want ti canceled as i copy over a setting file to make it the way i want.

Link to comment
Share on other sites

You should run it with @SW_HIDE flag, which hides installers window. Also, ControlClick () is way more better. Take a look in the help file or provide me with the installer and i'll write a script :)

does this seem about right?

@SW_HIDE
Run('Y:\apps\digiguide\digiguide.exe')
WinWait("DigiGuide Setup - Terms and Conditions","")
If Not WinActive("DigiGuide Setup - Terms and Conditions","") Then WinActivate("DigiGuide Setup - Terms and Conditions","")
WinWaitActive("DigiGuide Setup - Terms and Conditions","")
ControlClick("DigiGuide Setup - Terms and Conditions", "", "controlID [, middle [, 350 [, 341 ]]]")
WinWait("DigiGuide Setup - Destination","")
If Not WinActive("DigiGuide Setup - Destination","") Then WinActivate("DigiGuide Setup - Destination","")
WinWaitActive("DigiGuide Setup - Destination","")
ControlClick("DigiGuide Setup - Destination", "", "controlID [, middle [, 350 [, 341 ]]]")
WinWait("DigiGuide Setup Wizard","")
If Not WinActive("DigiGuide Setup Wizard","") Then WinActivate("DigiGuide Setup Wizard","")
WinWaitActive("DigiGuide Setup Wizard","")
ControlClick("DigiGuide Setup Wizard", "", "controlID [, right [, 367 [, 329 ]]]")

it is givign me a edit at line one so iu am guessing i have doen the hide windwo wrong

Edited by andrewcrawford
Link to comment
Share on other sites

Here is the fixed code :) >

Run('Y:\apps\digiguide\digiguide.exe','',@SW_HIDE)
WinWait("DigiGuide Setup - Terms and Conditions","")
$process=WinGetProcess("DigiGuide Setup - Terms and Conditions")
If Not WinActive("DigiGuide Setup - Terms and Conditions","") Then WinActivate("DigiGuide Setup - Terms and Conditions","")
WinWaitActive("DigiGuide Setup - Terms and Conditions","")
ControlClick("DigiGuide Setup - Terms and Conditions", "", "controlID [, middle [, 350 [, 341 ]]]")
WinWait("DigiGuide Setup - Destination","")
If Not WinActive("DigiGuide Setup - Destination","") Then WinActivate("DigiGuide Setup - Destination","")
WinWaitActive("DigiGuide Setup - Destination","")
ControlClick("DigiGuide Setup - Destination", "", "controlID [, middle [, 350 [, 341 ]]]")
WinWait("DigiGuide Setup Wizard","")
If Not WinActive("DigiGuide Setup Wizard","") Then WinActivate("DigiGuide Setup Wizard","")
WinWaitActive("DigiGuide Setup Wizard","")
ControlClick("DigiGuide Setup Wizard", "", "controlID [, right [, 367 [, 329 ]]]")
While ProcessExists($process)
Sleep(100)
WEnd
Exit

Hope will work now. Also, "next" or "install" buttons are identified by a class and a instance. You can get this info by using AutoIT Window Info tool. For example, a button identified by class "Button" and instance "3" you'll run this, in order for that button to be clicked :

ControlClick("DigiGuide Setup - Terms and Conditions","","Button3")

Hope it helps !

Edited by iuli_kyle
Link to comment
Share on other sites

Here is the fixed code :) >

Run('Y:\apps\digiguide\digiguide.exe','',@SW_HIDE)
WinWait("DigiGuide Setup - Terms and Conditions","")
$process=WinGetProcess("DigiGuide Setup - Terms and Conditions")
If Not WinActive("DigiGuide Setup - Terms and Conditions","") Then WinActivate("DigiGuide Setup - Terms and Conditions","")
WinWaitActive("DigiGuide Setup - Terms and Conditions","")
ControlClick("DigiGuide Setup - Terms and Conditions", "", "controlID [, middle [, 350 [, 341 ]]]")
WinWait("DigiGuide Setup - Destination","")
If Not WinActive("DigiGuide Setup - Destination","") Then WinActivate("DigiGuide Setup - Destination","")
WinWaitActive("DigiGuide Setup - Destination","")
ControlClick("DigiGuide Setup - Destination", "", "controlID [, middle [, 350 [, 341 ]]]")
WinWait("DigiGuide Setup Wizard","")
If Not WinActive("DigiGuide Setup Wizard","") Then WinActivate("DigiGuide Setup Wizard","")
WinWaitActive("DigiGuide Setup Wizard","")
ControlClick("DigiGuide Setup Wizard", "", "controlID [, right [, 367 [, 329 ]]]")
While ProcessExists($process)
Sleep(100)
WEnd
Exit

Hope will work now. Also, "next" or "install" buttons are identified by a class and a instance. You can get this info by using AutoIT Window Info tool. For example, a button identified by class "Button" and instance "3" you'll run this, in order for that button to be clicked :

ControlClick("DigiGuide Setup - Terms and Conditions","","Button3")

Hope it helps !

it is still failing :( the install program jsut doesnt seem to start up at all, (i mean i am checking task manager for it starting) i have used that program and now idenitifd as class #32770 first screen, and second. the final bit is sectionwindow061popup

btw thank you for all your help so far at the very least i am learning more about the control clicks

Link to comment
Share on other sites

It's impossible. Nothing is modified, but the parameter so it'll run with no window. Check that again :)

i found the error

'Y:\apps\digiguide\digiguide.exe' that was my bad because i was making the scritp from network share on virtual pc but that share doesnt exist in my network so i modified it to just the program name and it seems to be working fine

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
  • Recently Browsing   0 members

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