-
February 20th, 2009, 07:04 PM
#1
Pause thread while another program runs
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!
-
February 20th, 2009, 07:38 PM
#2
Re: Pause thread while another program runs
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.
-
February 20th, 2009, 09:29 PM
#3
Re: Pause thread while another program runs
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
-
February 21st, 2009, 05:37 PM
#4
Re: Pause thread while another program runs
Works perfectly!! Thanks so much!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|