Sign in to follow this  
Followers 0
Guest mlukhman

Changing Folder Location

5 posts in this topic

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?

Share this post


Link to post
Share on other sites



#2 ·  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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

may not be a standard edit box or may not be edit1, try the autoit window info tool on that screen and see what the control info is.

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

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.

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
Sign in to follow this  
Followers 0