mtatlis Posted March 25, 2008 Share Posted March 25, 2008 Can someone please help me I am new to programming and am trying to create an autoit script for installing software, but it is bypassing the select folder for installation. Here is a sample of my code. The line that it is bypassing is myWinWaitSend( @ScriptLineNumber, $title, $browse, 0, $destDir. Thank you If myWinWaitSend( @ScriptLineNumber, $title, 2, "", "{SPACE}", "" ) <> 0 then myWinWaitSend( @ScriptLineNumber, $title, 2, "", "{SPACE}", "" ) Else ; browse so that the destination can be changed myWinWaitSend( @ScriptLineNumber, $title, 0, "{SPACE}" ) myWinWaitSend( @ScriptLineNumber, $title, $welcome, 0, "{TAB}{SPACE}" ) myWinWaitSend( @ScriptLineNumber, $title, $browse, 0, $destDir, "{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}" _ "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{DOWN}{DOWN}{DOWN}{ENTER}", "{SPACE}{ENTER}" ) myWinWaitSend( @ScriptLineNumber, $title, 0, "{SPACE}" ) myWinWaitSend( @ScriptLineNumber, $title, $readytoinstall, 2, "", "{SPACE}", "" ) myWinWaitSend( @ScriptLineNumber, $title, $finish, 0, "", "{SPACE}" ) Link to comment Share on other sites More sharing options...
herewasplato Posted March 25, 2008 Share Posted March 25, 2008 Welcome to the forum. Please post the code for the myWinWaitSend UDF. Also, code like {TAB}{TAB}{TAB}{TAB} can be replaced with {TAB 4} But you might want to read up on the ControlClick function. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
mtatlis Posted March 25, 2008 Author Share Posted March 25, 2008 Welcome to the forum.Please post the code for the myWinWaitSend UDF.Also, code like {TAB}{TAB}{TAB}{TAB} can be replaced with {TAB 4}But you might want to read up on the ControlClick function.Hope this is waht you are looking for, as I am new at this#include "utils/package.au3"Global $_REALbasic_pkgDir = ""Global $_REALbasic_pkgPath = ""Global $_REALbasic_pkgKitDir = ""Global $_REALbasic_pkgKitPath = ""Global $_REALbasic_pkgIndx = _ myPkgAdd( "p_Basic", "REALbasic", _ $Package_Tab, False, "Basic" )myPkgCheckStandalone( "REALbasic" )Func _REALbasic_init() $pkgname = myGetPkgLogName( $_REALbasic_pkgIndx ) $_REALbasic_pkgDir = $baseDir & "\REALbasic" $_REALbasic_pkgPath = $basePath & "\REALbasic" $_REALbasic_pkgKitPath = "\Tools\REALbasic" $_REALbasic_pkgKitDir = $gDevKitsDir & $_REALbasic_pkgKitPath EndFuncFunc _REALbasic_info() dim $status = 0 _REALbasic_init() myLogEcho( 0, "Package Information: " & _ myGetPkgTitle( $_REALbasic_pkgIndx ) ) $status += myPackageInfo( "REALbasic" ) myLogMsgBox() return 0EndFuncFunc _REALbasic_verify() return myPackageVerify( "REALbasic" )EndFuncFunc _REALbasic_normal() return _REALbasic_install()EndFuncFunc _REALbasic_install() _REALbasic_init() dim $status = 0 dim $title = "REALbasic 2007r5 Setup" dim $welcome = "Welcome to REALbasic 2007r5 Setup Wizzard" dim $browse = "Browse to the destination folder" dim $readytoinstall = "The Setup Wizard is ready to begin the Custom installation" dim $finish = "Click the Finish button to exit the Setup Wizard" dim $workdir, $mdrive dim $installer = $_REALbasic_pkgKitDir & "\REALbasicSetup.exe" dim $destDir = $_REALbasic_pkgPath myScriptRun( @ScriptName, @ScriptLineNumber, $installer, $workdir ) ; ; If this package is not installed, the next window will not be displayed. ; If myWinWaitSend( @ScriptLineNumber, $title, 2, "", "{SPACE}", "" ) <> 0 then myWinWaitSend( @ScriptLineNumber, $title, 2, "", "{SPACE}", "" ) Else ; browse so that the destination can be changed myWinWaitSend( @ScriptLineNumber, $title, 0, "{SPACE}" ) myWinWaitSend( @ScriptLineNumber, $title, $welcome, 0, "{TAB}{SPACE}" ) myWinWaitSend( @ScriptLineNumber, $title, $browse, 0, $destDir, "{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}" _ "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{DOWN}{DOWN}{DOWN}{ENTER}", "{SPACE}{ENTER}" ) myWinWaitSend( @ScriptLineNumber, $title, 0, "{SPACE}" ) myWinWaitSend( @ScriptLineNumber, $title, $readytoinstall, 0, "{SPACE}", ) myWinWaitSend( @ScriptLineNumber, $title, $finish, 0, "", "{SPACE}" ) $status += _REALbasic_environment( "set" ) $status += _REALbasic_environment( "verify" ) EndIfEndFuncFunc _REALbasic_environment( $oper ) dim $status = 0 $status += myEnvVarOper( $oper, "REALbasic", $_REALbasic_pkgPath, _ True, True ) if ( $status > 0 ) Then $status = 1 EndIf return $statusEndFuncFunc _REALbasic_paths( $oper ) dim $status = 0 $status += myEnvDirOper( $oper, $_REALbasic_pkgPath ) if ( $status > 0 ) Then $status = 1 EndIf return $statusEndFunc Link to comment Share on other sites More sharing options...
herewasplato Posted March 25, 2008 Share Posted March 25, 2008 Hope this is waht you are looking for, as I am new at this...My apologies for using an abbreviation like UDF on a new user. UDF = User Defined Function.I was looking for the code (UDF) that the line you were having trouble with called. Func myWinWaitSend () ;some stuff hereEndFuncI don't see code like that in what you posted.Perhaps it is in the package.au3 file. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
mtatlis Posted March 25, 2008 Author Share Posted March 25, 2008 Hope this is waht you are looking for, as I am new at this#include "utils/package.au3"Global $_REALbasic_pkgDir = ""Global $_REALbasic_pkgPath = ""Global $_REALbasic_pkgKitDir = ""Global $_REALbasic_pkgKitPath = ""Global $_REALbasic_pkgIndx = _ myPkgAdd( "p_Basic", "REALbasic", _ $Package_Tab, False, "Basic" )myPkgCheckStandalone( "REALbasic" )Func _REALbasic_init() $pkgname = myGetPkgLogName( $_REALbasic_pkgIndx ) $_REALbasic_pkgDir = $baseDir & "\REALbasic" $_REALbasic_pkgPath = $basePath & "\REALbasic" $_REALbasic_pkgKitPath = "\Tools\REALbasic" $_REALbasic_pkgKitDir = $gDevKitsDir & $_REALbasic_pkgKitPath EndFuncFunc _REALbasic_info() dim $status = 0 _REALbasic_init() myLogEcho( 0, "Package Information: " & _ myGetPkgTitle( $_REALbasic_pkgIndx ) ) $status += myPackageInfo( "REALbasic" ) myLogMsgBox() return 0EndFuncFunc _REALbasic_verify() return myPackageVerify( "REALbasic" )EndFuncFunc _REALbasic_normal() return _REALbasic_install()EndFuncFunc _REALbasic_install() _REALbasic_init() dim $status = 0 dim $title = "REALbasic 2007r5 Setup" dim $welcome = "Welcome to REALbasic 2007r5 Setup Wizzard" dim $browse = "Browse to the destination folder" dim $readytoinstall = "The Setup Wizard is ready to begin the Custom installation" dim $finish = "Click the Finish button to exit the Setup Wizard" dim $workdir, $mdrive dim $installer = $_REALbasic_pkgKitDir & "\REALbasicSetup.exe" dim $destDir = $_REALbasic_pkgPath myScriptRun( @ScriptName, @ScriptLineNumber, $installer, $workdir ) ; ; If this package is not installed, the next window will not be displayed. ; If myWinWaitSend( @ScriptLineNumber, $title, 2, "", "{SPACE}", "" ) <> 0 then myWinWaitSend( @ScriptLineNumber, $title, 2, "", "{SPACE}", "" ) Else ; browse so that the destination can be changed myWinWaitSend( @ScriptLineNumber, $title, 0, "{SPACE}" ) myWinWaitSend( @ScriptLineNumber, $title, $welcome, 0, "{TAB}{SPACE}" ) myWinWaitSend( @ScriptLineNumber, $title, $browse, 0, $destDir, "{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}" _ "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{DOWN}{DOWN}{DOWN}{ENTER}", "{SPACE}{ENTER}" ) myWinWaitSend( @ScriptLineNumber, $title, 0, "{SPACE}" ) myWinWaitSend( @ScriptLineNumber, $title, $readytoinstall, 0, "{SPACE}", ) myWinWaitSend( @ScriptLineNumber, $title, $finish, 0, "", "{SPACE}" ) $status += _REALbasic_environment( "set" ) $status += _REALbasic_environment( "verify" ) EndIfEndFuncFunc _REALbasic_environment( $oper ) dim $status = 0 $status += myEnvVarOper( $oper, "REALbasic", $_REALbasic_pkgPath, _ True, True ) if ( $status > 0 ) Then $status = 1 EndIf return $statusEndFuncFunc _REALbasic_paths( $oper ) dim $status = 0 $status += myEnvDirOper( $oper, $_REALbasic_pkgPath ) if ( $status > 0 ) Then $status = 1 EndIf return $statusEndFunchere is the line that I am having trouble withmyWinWaitSend( @ScriptLineNumber, $title, $browse, 0, $destDir, "{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}" _"{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{DOWN}{DOWN}{DOWN}{ENTER}", "{SPACE}{ENTER}" ) Link to comment Share on other sites More sharing options...
herewasplato Posted March 25, 2008 Share Posted March 25, 2008 (edited) here is the line that I am having trouble withmyWinWaitSend( @ScriptLineNumber, $title, $browse, 0, $destDir, "{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}" _"{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{DOWN}{DOWN}{DOWN}{ENTER}", "{SPACE}{ENTER}" )Yes, that is the line that I thought that you were having trouble with according to your first post... but that line of code calls a UDF named myWinWaitSend.I cannot help much with that one line of code without seeing the UDF that it calls. Look for a line like: Func myWinWaitSend() and copy/paste/post that line and the code after it until the first EndFunc is reached. Again, the UDF may be inside the file named "package.au3". Edited March 26, 2008 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
mtatlis Posted March 25, 2008 Author Share Posted March 25, 2008 Yes, that is the line that I thought that you were having trouble with according to your first post... but that line of code calls a UDF named myWinWaitSend.I cannot help much with that one line of code without seeing the UDF that is calls. Look for a line like: Func myWinWaitSend() and copy/paste/post that line and the code after it until the first EndFunc is reached. Again, the UDF may be inside the file named "package.au3".Func myWinWaitSend($lineno, $title, $text, $timeout, $string, $string2) Dim $sentStatus = 0 Dim $msg = myFuncMsg("myWinWaitSend", $title, $text, $timeout, _ $string, $string2) myPosition($lineno, $msg) If WinWaitActive($title, $text, $timeout) Then $sentStatus = 1 Send($string) If (StringLen($string2) <> 0) Then Sleep(2000) Send($string2) EndIf EndIf Return $sentStatusEndFunc ;==>myWinWaitSend Link to comment Share on other sites More sharing options...
mtatlis Posted March 25, 2008 Author Share Posted March 25, 2008 Here is the UDf that calls the function myWinWaitSend Func myWinWaitSend($lineno, $title, $text, $timeout, $string, $string2) Dim $sentStatus = 0 Dim $msg = myFuncMsg("myWinWaitSend", $title, $text, $timeout, _ $string, $string2) myPosition($lineno, $msg) If WinWaitActive($title, $text, $timeout) Then $sentStatus = 1 Send($string) If (StringLen($string2) <> 0) Then Sleep(2000) Send($string2) EndIf EndIf Return $sentStatus EndFunc ;==>myWinWaitSend Link to comment Share on other sites More sharing options...
herewasplato Posted March 26, 2008 Share Posted March 26, 2008 (edited) This line... Func myWinWaitSend($lineno, $title, $text, $timeout, $string, $string2) ...accepts 6 parameters (parms): $lineno $title $text $timeout $string $string2 The line that you are having trouble with is feeding in more than 6 "parms". myWinWaitSend( @ScriptLineNumber, $title, $browse, 0, $destDir, "{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}" _ "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}", "{DOWN}{DOWN}{DOWN}{ENTER}", "{SPACE}{ENTER}" ) @ScriptLineNumber $title $browse 0 $destDir "{TAB}{TAB}{TAB}{TAB}{SPACE}" "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}" _ "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}" "{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}" "{DOWN}{DOWN}{DOWN}{ENTER}" "{SPACE}{ENTER}" Do you see the problem now? Do you know how to fix it on your own? Edit: I don't mean to sound rude. If you don't know the fix, then post back and we can keep working on it. Edited March 26, 2008 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
mtatlis Posted March 26, 2008 Author Share Posted March 26, 2008 thank you, I do not know how to fix this can you please hrlp me Link to comment Share on other sites More sharing options...
herewasplato Posted March 26, 2008 Share Posted March 26, 2008 Try this:myWinWaitSend(@ScriptLineNumber, $title, $browse, 0, $destDir, "{TAB 4}{SPACE}{TAB 5}{SPACE}{TAB 4}{SPACE}{TAB 5}{SPACE}{DOWN 3}{ENTER}{SPACE}{ENTER}")Somethings I had to guess at. I removed all of the commas and extra quotation marks from that last "parm". Now there are 6 parms... but I really did not know if you wanted to send the underscore character or if that was a "line continuation" character in your code editor. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
mtatlis Posted March 26, 2008 Author Share Posted March 26, 2008 Try this:myWinWaitSend(@ScriptLineNumber, $title, $browse, 0, $destDir, "{TAB 4}{SPACE}{TAB 5}{SPACE}{TAB 4}{SPACE}{TAB 5}{SPACE}{DOWN 3}{ENTER}{SPACE}{ENTER}")Somethings I had to guess at. I removed all of the commas and extra quotation marks from that last "parm". Now there are 6 parms... but I really did not know if you wanted to send the underscore character or if that was a "line continuation" character in your code editor. I have made the suggested change but it is still not working, the underscore character was for a line continuation, Link to comment Share on other sites More sharing options...
herewasplato Posted March 26, 2008 Share Posted March 26, 2008 The only aspects of the UDF that I know how to test seem to work using this little demo and notepad.Run("notepad") $title = "Untitled - Notepad" $browse = "" $destDir = "" myWinWaitSend(@ScriptLineNumber, $title, $browse, 0, $destDir, "{TAB 4}{SPACE}{TAB 5}{SPACE}{TAB 4}{SPACE}{TAB 5}{SPACE}{DOWN 3}{ENTER}{SPACE}{ENTER}") Func myWinWaitSend($lineno, $title, $text, $timeout, $string, $string2) Dim $sentStatus = 0 ;~ Dim $msg = myFuncMsg("myWinWaitSend", $title, $text, $timeout, $string, $string2) ;~ myPosition($lineno, $msg) If WinWaitActive($title, $text, $timeout) Then $sentStatus = 1 Send($string) If (StringLen($string2) <> 0) Then Sleep(2000) Send($string2) EndIf EndIf Return $sentStatus EndFunc ;==>myWinWaitSendSorry, I'm at a loss as to what to try next. Maybe some others in the forum can chime in. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now