Jump to content

Changing Folder Location


Guest mlukhman
 Share

Recommended Posts

Guest mlukhman

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?

Link to comment
Share on other sites

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

Link to comment
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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

Guest mlukhman

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