tags:

views:

63

answers:

1

Hi all,

  1. I need to install mysql in my system in the first step

  2. After installing or modifying the mysql in the system , I need to the run the data base scripts.

The problem here is db scripts started running before mysql setup completes. I have tried different ways.. using auto run methods...using processes etc

can anybody tell me how to capture the (child)process id which is invoked by the current process(parent). Here in my case parent is invoking child process and exiting.

+2  A: 

System.Diagnostics.Process has a method WaitForExit.

Edit: To also watch for subprocesses, you can use Win32 Job objects. If you create a process in a job, all of its child processes will also belong to the job (unless someone explicitly detaches them). You can monitor the job for events such as process creation and termination. There is a C# wrapper for job objects, JobObjectWrapper.

Martin v. Löwis
Hello Martin.Thanks for your response.Actually I have already tried WaitForExit but it doesnot fulfill my requirement. Here my process(mysql setup) is invoking another process(internal to the mysql setup). As soon as the the mysql setup popsup the next message, the next .exe in my installer is getting invoked.I have one more question for you:How to capture the process id of the child which is being invoked internally(I donot even know whether my assumption is correct or not,for capturing the process id ).
srinivas
in principle, job objects should help you; see my edit.
Martin v. Löwis