Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto program install

Status
Not open for further replies.

rickict

IS-IT--Management
Apr 29, 2005
18
GB
hi im trying to right a script to auto install an application from start to finish.
heres my code
Code:
use Win32::GuiTest qw( FindWindowLike
                       PushChildButton );
use strict;

#start the app.
system ("c:\\Documents and settings\\rick\\my documents\\Thunderbird Setup 1.0.6.exe");

#advance the install program.
my @whnds = FindWindowLike( undef, "^Mozilla Thunderbird Setup" );
if( !@whnds ){
    die "Cannot find window with title/caption Calculator\n";
}else{
    printf( "Window handle of calculator application is %x\n", $whnds[ 0 ] );
}
PushChildButton( $whnds[ 0 ], 12324 ); # next button
PushChildButton( $whnds[ 0 ], 12324 ); # next button
PushChildButton( $whnds[ 0 ], 1081 ); # next button
PushChildButton( $whnds[ 0 ], 12324 ); # next button
PushChildButton( $whnds[ 0 ], 11007 ); # next button
PushChildButton( $whnds[ 0 ], 12324 ); # next button
all works well if i seperate the #start app part and the
#advance install program .
but put together, it just stops after the setup prog has launched.

how can i get the script to stop and wait for the setup prog to have started so it can then except the next commands to advance the install?
thanks ...rick
 
You might want to fork a child process to run the "system" call cos I bet the system call is blocking and not returning control until the .exe has completed.
Of course the .exe cannot complete until it exits and so you'll wait forever.


Trojan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top