Click here to Skip to main content
15,897,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My code is below :
VB
Dim filePathArg As String = "C:\Documents and Settings\Administrator\Desktop\MSI Installer\Dependency Setup\SQL Setup\x86\setup\setupsql.exe Start /Wait -s -fl ""C:\Documents and Settings\Administrator\Desktop\MSI Installer\Dependency Setup\SQL Setup\x86\setup\setup.iss"""

Shell(filePathArg, AppWinStyle.Hide)


Above code is perfectly running to install in SQL server 2000 in silent mode(i.e. command prompt)
But i want to do that other next line will debuging after complete background process (i.e. to wait running debug)

How will i solve the above problem??
Please help me..
Posted
Updated 30-Dec-11 23:17pm
v2
Comments
Sergey Alexandrovich Kryukov 31-Dec-11 12:34pm    
Not clear. What is "other next line"? What process do you call "background"? "SetupSql"?
--SA

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900