Jump to content

Recommended Posts

Guest mlukhman
Posted

I'm currently writing scripts to perform installs but we want these programs to be located within c:\program files folder hierachy. Some of the installer I have place the application elsewhere so have to change the folder location accordingly. With AutoIt I use a combination

; Please choose the installation folder

$TITLE="Choose Folder"

$TEXT="Edit"

if WinExists($TITLE, $TEXT) Then

WinActivate($TITLE, $TEXT)

ControlSend($TITLE, $TEXT, "Edit1", $LOCATION)

ControlClick($TITLE, $TEXT, 4, "Edit1")

EndIf

or

; Please choose the installation folder

$TITLE="Choose Folder"

$TEXT="Edit"

if WinExists($TITLE, $TEXT) Then

WinActivate($TITLE, $TEXT)

Send($LOCATION)

ControlClick($TITLE, $TEXT, 4, "Edit1")

EndIf

These work but I've now come to an installer where Send() or ControlSend()

don't seem to being acted upon (i.e. the folder location is being left unchanged).

Haven't a clue as who do deal with this problem.

Any suggestions?

Posted (edited)

for the folder only use this

$var = FileSelectFolder("Choose a folder.", "")

or maybe this for folder and file name

$var = FileSaveDialog( "Choose a name.", $MyDocsFolder, "Scripts (*.aut;*.au3)", 3)
; option 3 = dialog remains until valid path/file selected

If @error Then
    MsgBox(4096,"","Save cancelled.")
Else
    MsgBox(4096,"","You chose " & $var)
EndIf

you can see these in help

also

@ProgramFilesDir & "\" shows the program files folder

8)

Edited by Valuater

NEWHeader1.png

Posted

Does Au3Info tool report the control "Edit1" as hidden? Is a browse button available?

WinExists() is not a waiting function, so it could execute before the window appears. WinWait maybe more suitable?

Your ControlClick() functions are incorrect. "Edit1" is not button to click.

[optional]The button to click, "left", "right" or "middle". Default is the left button.

Guest mlukhman
Posted

Your ControlClick() functions are incorrect. "Edit1" is not button to click.

<{POST_SNAPBACK}>

Your right. Spotted that mistake just now, and it's now working fine.

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