The question is very unclear.
Perhaps you need to be able to wait until installation process is complete. To do it, use
System.System.Diagnostics.Process.Start
methods instead of
Shell
.
See
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[
^].
Static methods will return the instance of
Process
; and the non-static method
Process.Start()
is called on a previously created instance of
Project
you can create with its constructor, with
Project.StartInfor
property assigned to the start info you want.
See
System.Diagnostics.ProcessStartInfo
,
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.aspx[
^].
In both cases, you have an instance of
Process
to see the status of the project after the process is started; you can use
Process.ExitCode
(handle exceptions, see the help on this property). When you know that the process has been successfully started, you can wait for the moment of time when it is complete using the method
WaitForExit
.
As all Wait methods, this method is blocking! You better to call it all in a separate thread.
—SA