Incorrect Exit Code from wyUpdate via Command Line

We are experiencing an issue where wyUpdate.exe appears to return the wrong exitcode when run with the command line parameters /quickcheck /justcheck /noerr. With an update available, wyUpdate is returning a 0. Yet, if we simply run the wyUpdate GUI via doubleclicking it (or via command line with only the /quickcheck parameter), then the GUI window correctly shows that an update is available. Because our application (a Windows service) invokes wyUpdate via "wyupdate.exe /quickcheck /justcheck /noerr", which is consistently returning an exit code of 0, the application never updates. Any ideas as to what's wrong? FYI - We are using the latest version of wyupdate.exe (2.6.18), and this isn't a path to client.wyc issue because wyUpdate correctly returns an error if you move or rename the client.wyc file. This also isn't an issue with an improper version of the client.wyc file, because again, if you allow the GUI (non-silent method) to open, it finds the update.

More info... This appears to be an issue with the /noerr parameter. Using /noerr properly supresses the GUI from launching in the event of an error, but wyUpdate does not return a 1, as documented. Instead it returns a 0, indicating (incorrectly) that our application is up to date.

Can you paste the code you're using to launch wyUpdate? Better yet, create a sample service that reproduces this, because we can't reproduce it here.

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 ...}

I'll look into this later this evening.

We've fixed this bug, it will be out with the next version.

Also, you should use "start /wait" to wait for wyUpdate to exit (e.g. "start /wait wyUpdate.exe /quickcheck .... etc.").

Has the fix for this been released yet, or is there any other workaround?

I've been testing the trial today using wyBuild and wyUpdate both at version 2.6.18.4 and am seeing the same behaviour when checking for updates on the command line; wyUpdate returns 0 even though there are updates when run silently but works as expected if launched without command line switches.

Hey Gary,

The next version is still about a month away. The fix is checked into the public wyUpdate source code repository, so you can use that in the meantime: http://code.google.com/p/wyupdate/

Hi there, I am also experiencing the same problem,my exit code always return 0 even when there's update available,but update is available when I directly opening the wyupdate.exe

FYI, i am coding this in silent update (C++).

I am new to this and is there a fix to the problem yet?

Thanks and Sincerely.

Hi Wyatt/Sam,

I am also experiencing the same error. Please suggest me how to fix this one. I am running version 2.6.18.4.