The easiest way to reproduce it is with a simple batch file:
@echo offwyupdate.exe /quickcheck /justcheck /noerr /outputinfo="out.txt"echo Exit code is %ERRORLEVEL%pause
Run it in a folder with wyupdate.exe and client.wyc. If an update is available, you'll get 2, and if not, you'll get 0. Now induce an error. A simple way is to just delete client.wyc. Run the batch and you'll get a 0 rather than the expected 1. Taking a look at the out.txt file reveals the details of the induced error.
Our real-world method of invoking wyupdate is a C# application that looks something like this...
string updaterPath = Path.Combine(_applicationSettings.BasePath, "wyUpdate.exe");ProcessStartInfo updateCheckProcessInfo = new ProcessStartInfo(updaterPath, "/quickcheck /justcheck /noerr");
updateCheckProcessInfo.CreateNoWindow = true;
updateCheckProcessInfo.WorkingDirectory = _applicationSettings.BasePath;Process updateCheckProcess = Process.Start(updateCheckProcessInfo);updateCheckProcess.WaitForExit(300000);
if (!updateCheckProcess.HasExited){ // Deal with issue ...}
switch (updateCheckProcess.ExitCode){ case 0: // No Updates found ...
case 1: // Error ...
case 2: // Update available ...}