raw Posted March 8, 2006 Share Posted March 8, 2006 Ive created a autoIt3 script that launches setup program Run(setup.exe) that makes the appropriate mouse clicks and installs a software package. Ive compiled the script to an executable. The software installs properly however, it appears that after the executable (compiled script) completes, the AutoIt application is still running. An AutoIT icon is in the system tray in a paused state. I have to manually click the AutoIT icon to exit AutoIT. My question is, is there a command that I need to put at the end of the script to tell AutoIT the script is finished and should exit the AutoIt program? Link to comment Share on other sites More sharing options...
cdkid Posted March 8, 2006 Share Posted March 8, 2006 Can you please post your code, so people will be able to help you a bit more? AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
Joon Posted March 8, 2006 Share Posted March 8, 2006 You can do 'exit' to force termination. I guess is you might have WinWait with no timeout toward the end of your script. TrayIconDebug to see where it is in the script. Link to comment Share on other sites More sharing options...
ChrisL Posted March 8, 2006 Share Posted March 8, 2006 When you click on the Icon in the tray it changes to a pause state, I would guess that the code is stuck in a loop or waiting for a window not paused [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
raw Posted March 9, 2006 Author Share Posted March 9, 2006 Can you please post your code, so people will be able to help you a bit more?Here is a copy of my script. Again, the application appears to install correctly, no problems there. Any insight you may have would be greatly appreciated!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Opt("WinWaitDelay",100)Opt("WinTitleMatchMode",4)Opt("WinDetectHiddenText",1)Opt("MouseCoordMode",0)Run('setup.exe'); Screen #1WinWait("InstallUpdates","Please enter the lan")If Not WinActive("InstallUpdates","Please enter the lan") Then WinActivate("InstallUpdates","Please enter the lan")WinWaitActive("InstallUpdates","Please enter the lan")ControlFocus("InstallUpdates","Please enter the lan",1)ControlClick("InstallUpdates","Please enter the lan",1,"left",1); Screen #2 - WelcomeWinWait("InstallUpdates","The InstallUpdates.e")If Not WinActive("InstallUpdates","The InstallUpdates.e") Then WinActivate("InstallUpdates","The InstallUpdates.e")WinWaitActive("InstallUpdates","The InstallUpdates.e")ControlFocus("InstallUpdates","The InstallUpdates.e",1)ControlClick("InstallUpdates","The InstallUpdates.e",1,"left",1); Screen #3 - 1 License AgreementWinWait("InstallUpdates","I do not accept the ")If Not WinActive("InstallUpdates","I do not accept the ") Then WinActivate("InstallUpdates","I do not accept the ")WinWaitActive("InstallUpdates","I do not accept the ")ControlFocus("InstallUpdates","I do not accept the ",1029)ControlClick("InstallUpdates","I do not accept the ",1029,"left",1); Screen #3 - 2 License Agreement - NextWinWaitActive("InstallUpdates","I do not accept the ")ControlFocus("InstallUpdates","I do not accept the ",1028)ControlClick("InstallUpdates","I do not accept the ",1028,"left",1); Screen #4 - 1 Service Startup ModeWinWait("InstallUpdates","Do not Start Service")If Not WinActive("InstallUpdates","Do not Start Service") Then WinActivate("InstallUpdates","Do not Start Service")WinWaitActive("InstallUpdates","Do not Start Service")ControlFocus("InstallUpdates","Do not Start Service",1010)ControlClick("InstallUpdates","Do not Start Service",1010,"left",1); Screen #4 - 2 Service Startup Mode - NextWinWaitActive("InstallUpdates","Do not Start Service")ControlFocus("InstallUpdates","Do not Start Service",1)ControlClick("InstallUpdates","Do not Start Service",1,"left",1); Screen #5 Finish WindowWinWait("InstallUpdates","Finish Window")If Not WinActive("InstallUpdates","Finish Window") Then WinActivate("InstallUpdates","Finish Window")WinWaitActive("InstallUpdates","Finish Window")ControlFocus("InstallUpdates","Finish Window",1)ControlClick("InstallUpdates","Finish Window",1,"left",1); Screen #6 (After Installation) WinWait("After Installation","After installation, please click Next.")If Not WinActive("After Installation","After installation, please click Next.") Then WinActivate("After Installation","After installation, please click Next.")WinWaitActive("After Installation","After installation, please click Next.")ControlFocus("After Installation","After installation, please click Next.",12325)ControlClick("After Installation","After installation, please click Next.",12325,"left",1); Screen #7 Finish Admin Install - Finish WinWait("Finish Admin Install","When the installation has ended")If Not WinActive("Finish Admin Install","When the installation has ended") Then WinActivate("Finish Admin Install","When the installation has ended")WinWaitActive("Finish Admin Install","When the installation has ended")ControlFocus("Finish Admin Install","When the installation has ended",12325)ControlClick("Finish Admin Install","When the installation has ended",12325,"left",1)Sleep(1000)WinCloseExit Link to comment Share on other sites More sharing options...
Stumpii Posted March 9, 2006 Share Posted March 9, 2006 Second line from the bottom has WinClose with no arguments. Try changing that as see if it makes a difference. “Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.”AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity. Link to comment Share on other sites More sharing options...
Valuater Posted March 9, 2006 Share Posted March 9, 2006 (edited) i see that it sleeps/waits 1 second before it tries to close the install window does the install window actually close ... if it does close then the "Exit" you have should work i would suggest putting a messagebox between the last few lines to test where the program is hanging up 8) EDIT good one Stumpi... that should actually give an error ( i think ) Edited March 9, 2006 by Valuater Link to comment Share on other sites More sharing options...
CyberSlug Posted March 9, 2006 Share Posted March 9, 2006 I cannot stand redundant code! I suggest trying something like the following:Opt("TrayIconDebug", 1); FOR DEBUGGING TO SEE IF PROGRAM GETS STUCK Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) Run('setup.exe') Dim $WindowTitle = "InstallUpdates" MyClick($WindowTitle, "Please enter the lan", 1) ; Screen #1 MyClick($WindowTitle, "The InstallUpdates.e", 1) ; Screen #2 - Welcome MyClick($WindowTitle, "I do not accept the ", 1029) ; Screen #3 - 1 License Agreement MyClick($WindowTitle, "I do not accept the ", 1028) ; Screen #3 - 2 License Agreement - Next MyClick($WindowTitle, "Do not Start Service", 1010) ; Screen #4 - 1 Service Startup Mode MyClick($WindowTitle, "Do not Start Service", 1) ; Screen #4 - 2 Service Startup Mode - Next MyClick($WindowTitle, "Finish Window", 1) ; Screen #5 Finish Window ; Screen #6 (After Installation) MyClick("After Installation", "After installation, please click Next.", 12325) ; Screen #7 Finish Admin Install - Finish MyClick("Finish Admin Install", "When the installation has ended", 12325) Exit ; Factor out reduntant code with this function. ; You might not even need the WinActivate / WinWaitActive / ControlFocus lines Func MyClick($title, $win, $controlID) WinWait($title, $text) WinActivate($title, $text);need or not? WinWaitActive($title, $text);need or not? ControlFocus($title, $text, $controlID);need or not? ControlClick($title, $text, $controlID) EndFunc Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
greenmachine Posted March 9, 2006 Share Posted March 9, 2006 I cannot stand redundant code! I suggest trying something like the following:Opt("TrayIconDebug", 1); FOR DEBUGGING TO SEE IF PROGRAM GETS STUCK Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) Run('setup.exe') Dim $WindowTitle = "InstallUpdates" MyClick($WindowTitle, "Please enter the lan", 1) ; Screen #1 MyClick($WindowTitle, "The InstallUpdates.e", 1) ; Screen #2 - Welcome MyClick($WindowTitle, "I do not accept the ", 1029) ; Screen #3 - 1 License Agreement MyClick($WindowTitle, "I do not accept the ", 1028) ; Screen #3 - 2 License Agreement - Next MyClick($WindowTitle, "Do not Start Service", 1010) ; Screen #4 - 1 Service Startup Mode MyClick($WindowTitle, "Do not Start Service", 1) ; Screen #4 - 2 Service Startup Mode - Next MyClick($WindowTitle, "Finish Window", 1) ; Screen #5 Finish Window ; Screen #6 (After Installation) MyClick("After Installation", "After installation, please click Next.", 12325) ; Screen #7 Finish Admin Install - Finish MyClick("Finish Admin Install", "When the installation has ended", 12325) Exit ; Factor out reduntant code with this function. ; You might not even need the WinActivate / WinWaitActive / ControlFocus lines Func MyClick($title, $win, $controlID) WinWait($title, $text) WinActivate($title, $text);need or not? WinWaitActive($title, $text);need or not? ControlFocus($title, $text, $controlID);need or not? ControlClick($title, $text, $controlID) EndFunc I agree, redundant code is irritating. Just a little thing I noticed in the function definition: "Func MyClick($title, $win, $controlID)" You never use $win in the function (it is $text). Might want to update that. 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