wyUpdate.exe /justcheck returns 0 when updates are availble

Hi,

I'm using this code to check for updates from a windows service

var p = Process.Start("wyUpdate.exe", "/quickcheck /justcheck /noerr");p.WaitForExit();if (p.ExitCode == 2) { ... }

When this code is compiled into a console app and run from service directory, it works. However, when run from the service, wyUpdate.exe always returns 0, even if updates are available. The service runs under LocalSystem user.

Everything works fine here. It sounds like the client.wyc in the directory of the service is updated to the latest version (and thus is reporting that fact). Try double clicking the wyUpdate.exe in your service's directory. I'm sure it will say you're already using the latest version.

Short answer: rebuild wyUpdate.exe with the correct verison number selected from the drop down list. Then include that wyUpdate.exe and client.wyc with your service.

No, it isn't updated to the latest version. Running wyUpdate.exe would download and install the update, and running wyUpdate.exe /justcheck /quickcheck /noerr returns 2 (which means update is available, which is correct).

The only scenario that doesn't work is when wyUpdate.exe /justcheck /quickcheck /noerr is started from the service itself using the code above, in which case it returns 0 (meaning no updates are available, which is incorrect). I tried adding /outputinfo=log.txt, but no file is created.

Put in the full path of wyUpdate.exe (not just "wyUpdate.exe" but "C:\Location\To\wyUpdate.exe"). Make sure the full path points to the same wyUpdate.exe that was reporting you have an update.

yes, it really is the same wyUpdate.exe

No, I'm saying explicitly put in the full path in your Process.Start() call.

It sounds like your service might be calling another wyUpdate.exe, and thus working off another client.wyc file (and because you're not putting in the full path, you don't know which wyUpdate.exe is being called).

Still the same behaviour, even when called with full wyUpdate.exe path.

Ok, then it must be the code that's incorrect (because we can't reproduce this behavior here). If you can send me the service code as it is (with the incorrect behavior). If you can't do that, can you make another test service that reproduces the same behavior. Also send the client.wyc that you're including in the directory as that service.

Send them to support@wyday.com.

It is impossible to send the service code, it is part of a complex application that needs installation.Also, it was tested on two machines and on one of them it works as expected.

I made this small tool (wyUpdateWrapper.exe) to test the behaviour:

static int Main(string[] args) { var wyUpdatePath = Path.Combine(Directory.GetCurrentDirectory(), "wyUpdate.exe"); log("Starting " + wyUpdatePath);

var p = Process.Start(wyUpdatePath, "/quickcheck /justcheck /noerr /outputinfo=\"wyUpdate.txt\""); log("wyUpdate.exe started"); p.WaitForExit(); log("wyUpdate.exe exited, ExitCode: " + p.ExitCode.ToString());

return p.ExitCode; }

Then I configured the service to run wyUpdateWrapper.exe instead of wyUpdate every two minutes. When run manually from command line, the log contains

Starting C:\Program Files (x86)\Praetor Systems s.r.o\Praetor Server Alpha\wyUpdate.exewyUpdate.exe startedwyUpdate.exe exited, ExitCode: 2

and wyUpdate.exe is created with the new version info.

However, when run from the service, it contains

Starting c:\Program Files (x86)\Praetor Systems s.r.o\Praetor Server Alpha\wyUpdate.exewyUpdate.exe startedwyUpdate.exe exited, ExitCode: 0

and no wyUpdate.txt is created.

There is nothing much interesting in the service code itself, the wyUpdateWrapper.exe is started every two minutes using Process.Start. The service runs under LocalSystem.

The wyUpdate.exe is version 2.6.18.4

I am sending the client.wyc by email.

Thank you for your help.

I'll look into this later today.

Hi,

I'm having the exact same problem. Is there a workaround for this issue ?

Close all copies of wyUpdate running on the system (you likely have a stray copy running somewhere in the same session or another session). Then try again.

Hi sorry i found this problem also occurs to mine, any workaround?

Thank you.

Almost certainly there's another copy of wyUpdate running. Close all copies of wyUpdate.

If you want, you can try the latest wyUpdate in our repository and see if that fixes the problem (it returns more error codes).

hi Wyatt,

Thanks for replying, I restarted my PC and first launch on my program but still return 0, so I think that's not the issue.

BTW, may I know where to get the latest version ? Because my wyBuild is updated to the latest version.

Thanks.

Hi Wyatt, sorry it was my mistake on some code, I now have my update available and thank you once again for your patience and kindness into making this software!

Thanks and have a nice day!

papaonn wrote:> Hi Wyatt, sorry it was my mistake on some code, I now have my update> available and thank you once again for your patience and kindness into> making this software!> > Thanks and have a nice day!

Why didn't you post the fix. I'm having the same issue and I'm pretty sure its some stupidity 😮 on my part. Extremely frustrating 😈