idoru Posted November 13, 2008 Share Posted November 13, 2008 Hi Guys, This is my forst post to this forum so Hello all Normally I would sit and work this kind of thing out for myself but I'm under some time contraints so basically I need your help. I'm writing (my first ever autoit) script to benchmark the compilation times of wsi installer projects. The problem I'm having is with the actually timer itself. I've read the help files and these forums from top to bottom but Im no clearer on how Im going to do this. Heres what I have so far. $message = "Select file to benchmark." $var = FileOpenDialog($message, @ComputerName & "\", "All Files (*.*)") Run("W:\WisePkgStudio\Wise Package Studio\Windows Installer Editor\WfWI.exe") If @error Then MsgBox(4096,"","No File(s) chosen") Else WinWaitActive("SQL Server Login") Send("{TAB 5}") Send("{NUMPADADD}") Send("{enter}") Send("^{o}") WinWaitActive("Open") Send($var) Send("{enter}") Send("{F7}") WinWaitActive("Saving Installation") EndIf Basically it opens the files navigates the Wise menus and loads the desired file. what I need now is, after WinWaitActive("Saving Installation") to start a timer then stop it once that window is no longer active. Preferably the script would then write the time to a text file named after the computer name and copy it to a file share however that im sure I'll be able to figure out for myself. Anyone think they can help with this? Thanks in advance Link to comment Share on other sites More sharing options...
AzKay Posted November 13, 2008 Share Posted November 13, 2008 Didnt look in the helpfile well then, Or you wouldve seen TimerInit() TimerDiff() oo WinWaitActive("Saving Installation") $Timer = TimerInit() While 1 If Not WinActive("Saving Installation") Then ExitLoop WEnd MsgBox(0, "", $Timer) # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
idoru Posted November 13, 2008 Author Share Posted November 13, 2008 I had noticed both of those in the helpfile but the example given isnt very clear. I cracked it just before you posted although ive taken a slightly differant approach which seems to work fine. WinWaitActive("Saving Installation") $starttime = _Timer_Init() WinWaitClose("Saving Installation") $endtime = _Timer_Diff($starttime) I then output $endtime to a text file. I think I was trying to make it more complicated than it actually is. Thanks for your help though. Link to comment Share on other sites More sharing options...
AzKay Posted November 13, 2008 Share Posted November 13, 2008 Yeah, Sorry. I typo'd. Shouldve been MsgBox(0, "", TimerDiff($Timer)) # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
idoru Posted November 13, 2008 Author Share Posted November 13, 2008 OK I now have another problem I can copy over the directory containing all the files for the benchmark however I need to pause the script until this has completed. I dont want to just use a sleep(xxx) cos the time to copy will vary with network conditions. I'm reasonably sure the answer lies in spawning a progress bar for the file copy however I dont know how to feed the progress of the copy to the bar. Any ideas? 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