Also, nothing is written to the console when I run wyUpdate.exe straight from the console.
Ps, I'll be off of work in 15 minutes and will not be able to respond until I come back on Tuesday.
Thanks in advance,-SS
Here is the scenario; I have multiple executables, written in multiple languages, that need to be updated, not all at the same time.
The solution is to use a console application written in C# that will accept a few arguments like, path to the application that is checking for the update and the window handle.
The colsole app that gets called will run the wyUpdate.exe that is in the folder of the calling application and pass in the params; /quickcheck /justcheck /noerr to check for updates for that particular application. In the docs, it says I should get a return from wyUpdate.exe of 0, 1 or 2.
Below is the code that runs wyUpdate.exe but for some reason, I get no return.
string appPath = Path.GetDirectoryName(fileNameFullPath); string updaterPath = Path.Combine(appPath, "wyUpdate.exe");
var proc = new Process { StartInfo = new ProcessStartInfo { FileName = updaterPath, Arguments = "/quickcheck /justcheck /noerr", UseShellExecute = false, RedirectStandardOutput = true, CreateNoWindow = true } };
proc.Start(); StringBuilder sbOutput = new StringBuilder(); while (!proc.StandardOutput.EndOfStream) { sbOutput.Append(proc.StandardOutput.ReadLine()); // do something with line }
if (sbOutput.ToString().Length > 1) { //log here to get proper info to truncate the string to a 0, 1 or 2 //0 == no new backup //1 == error //2 == new backup found Console.WriteLine(sbOutput.ToString()); }
The while loop gets passed by. Omitting the loop and just reading gets nothing as well.
Can someone please shed some light on this?
Also, nothing is written to the console when I run wyUpdate.exe straight from the console.
Ps, I'll be off of work in 15 minutes and will not be able to respond until I come back on Tuesday.
Thanks in advance,-SS
Never mind, I'm an idiot. process.ExitCode is the int property I was looking for. Now, the fun really begins on Tuesday!!
🙂 happy weekend everyone!
Glad you figured it out 😀 . Have a good weekend.