rshultz Posted April 11, 2006 Share Posted April 11, 2006 I have a script that I would like to run Firefox from cd so it copies Firefox to the temp directory much like Firefox Portable. The problem is that I have it do a RunWait to open Firefox and it continues to execute, I want it to clean up the temp files when Firefox is closed thus the reason for using the RunWait. Below is my script. Any ideas would be appreciated. Thanks. ; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: Ryan Shultz <xxxxxxxxxx> ; ; Script Function: Firefox Portable Browser with AgTerror Content ; ; ; ---------------------------------------------------------------------------- ; ----------------- ; Build SplashImage ; ----------------- $copyright = Chr("169") $destination = @TempDir & "\etc_logo.bmp" FileInstall("etc_logo.jpg", $destination) ;source must be literal string SplashImageOn($copyright & "2006 - Environmental Training Center", $destination, 350, 150, -1, -1, 3) Sleep(2000) ; ------------------- ; Collect Information ; ------------------- $maintemp = @TempDir $ffoxtemp = @TempDir & "\Firefox" DirRemove($ffoxtemp, 1) ; PreRun File Cleanup DirCopy("Firefox", $ffoxtemp, 1) $etccontent = """" & @ScriptDir & """\Content\index.htm""" ; ---------------- ; Run Applications ; ---------------- RunWait($ffoxtemp & "\firefox.exe -profile " & $ffoxtemp & "\profile\foxoafvu.default " & $etccontent, "", @SW_MAXIMIZE) ; ------------ ; Splash Stuff ; ------------ SplashOff() SplashTextOn("AgTerror", "Cleaning up temporary files...", 250, 20, -1, -1, "", -1) ; -------------- ; Delete Firefox ; -------------- Sleep(1000) DirRemove($ffoxtemp, 1) FileDelete($destination) SplashOff() Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 11, 2006 Moderators Share Posted April 11, 2006 (edited) Maybe do:Do Sleep(10) Until FileExists($destination); Or Until FileExists($ffoxtemp) ... I don't know what is what. ; ---------------- ; Run Applications ; ---------------- RunWait($ffoxtemp & "\firefox.exe -profile " & $ffoxtemp & "\profile\foxoafvu.default " & $etccontent, "", @SW_MAXIMIZE)? If I'm understanding you right that may work. Also... You may want to use code tags for you scripts. Edited April 11, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
rshultz Posted April 12, 2006 Author Share Posted April 12, 2006 Unfortunately that did not work. It is not a matter of the file not existing yet as it has copied prior to the actual run of the application. The problem comes that the actual script does not see that the application is still running even though it is. It should run Firefox then continue waiting until Firefox closes. 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