Click to See Complete Forum and Search --> : Pause thread while another program runs


PatrikD
February 20th, 2009, 06:04 PM
I'm writing a small program which checks to see if a handful of other programs are installed on the user's machine. If they aren't, my application will launch the setup files for them. I've already figured out how to check the registry for the other programs and launch the setup files... but I want my program to "pause" while each setup is running, and start back up when each setup is finished. This is so they don't open all at once.

Any ideas?

THANKS!

Arjay
February 20th, 2009, 06:38 PM
When you start the process using the Process class, just call the Wait.For.Exit (minus the dots) method to wait for the process to finish.

Tip: if your application has a UI, launch the processes (using the Process class) in a separate thread. If you don't, then your UI will freeze during the Wait.For.Exit( ) call.

dglienna
February 20th, 2009, 08:29 PM
I'd have to suggest Powershell 2.0 CTP. You can easily create scripts as well as execute (via INVOKE command-let objects) them, using the -wait parameter for each step.

( it took me *way* too long to figure that out)

just call the Wait.For.Exit (minus the dots)

* must be a RESERVED command, not hiding the S in BS

PatrikD
February 21st, 2009, 04:37 PM
Works perfectly!! Thanks so much!