Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# start process and wait for exit code

    public virtual bool Install(string InstallApp, string InstallArgs)
    {
        System.Diagnostics.Process installProcess = new System.Diagnostics.Process();
        //settings up parameters for the install process
        installProcess.StartInfo.FileName = InstallApp;
        installProcess.StartInfo.Arguments = InstallArgs;

        installProcess.Start();

        installProcess.WaitForExit();
        // Check for sucessful completion
        return (installProcess.ExitCode == 0) ? true : false;
    }
 
PREVIOUS NEXT
Tagged: #start #process #wait #exit #code
ADD COMMENT
Topic
Name
1+5 =