Hey Denis,
You might be running other instances of wyUpdate on the computer (and thus the new wyUpdate instance is closing immediately).
I call wyUpdater from one app, check if there is some updates and download it if it is.
On my comp it works fine but on some another comps it does not works: I get return code -2
Well, my main question is: what -2 means and what happens, why wyUpdater all time is closed?
I get return code -2 when run the wyUpdater without any parameters.But when I start wyUpdater manually, not from that app - everything works perfectly.
Okay... step-by-step.I read "How to Silently Check for Updates" and I did everything as written. I start wyUpdater with /quickcheck and /justcheck params just to get information is any updates on the server. After that if there is some updates start wyUpdater again but without any params. And in this moment wyUpdater immediately closed (I even don't see its window) and return -2 code.
This is my code how I call wyUpdater:
if(QFile::exists(appUpdater)) { // Check for updates if wyUpdater is in correct place params << "/quickcheck" << "/justcheck"; int exitCode = QProcess::execute(appUpdater, params); if(exitCode == 2) { // We have updates, so we have to restart that updater (for downloading) exitCode = QProcess::execute(appUpdater); if(exitCode == 3) { // In updater was clicked 'Cancel' button } } } else { // wyUpdater does not found } // launch main app
I sincerely hope you can help me make sense of this...
TXDenis
Hey Denis,
You might be running other instances of wyUpdate on the computer (and thus the new wyUpdate instance is closing immediately).
Could you please clarify... about multiple instances.
I am a new customer and trying to use the updater in several different software applications. In each application I give it a different name.
For example one is: VS2wyUpdate.exeAnother is: SSwyUpdate.exe
Are you saying I cannot have these two files in different program folders on the same machine... or rather if I do they won't run. Please explain.
Tx.
Only if they share the same GUID they won't be able to run at the same time. Double click the client.wyc for each of your products. Is the GUID different? If so, then you'll have no trouble running those 2 separate updates at the same time.
You can test this real quick by double clicking one of your updaters then double clicking it again. You'll see instead of launching another updater for the same app it instead focuses the existing running updater while it kills itself without showing the user anything.
Okay I have checked the GUID's and they are all different. So, we need to go back to the beginning. What is this -2 error code, and what might be causing it - and how do we fix whatever the problem is.
wyUpdate doesn't return -2. It does however return "2" when there's an update available. See: http://wyday.com/wybuild/help/silent-checking.php
For the cases where this happening, open the task manage. Do your see another instance of wyUpdate.exe running? (Or whatever you renamed it to).
Hi Wyatt,
You write: "wyUpdate doesn't return -2" but it does!This is scrinshot of my code: http://goo.gl/M4bCYE
In string #15 I run wyUpdate first time (with params) than, after wyUpdate finished its work, it returns me or 0 or 2. Upon reaching twenty-first row the above process has been completed so then in str.#21 we start the next one. Which return -2. And return it wyUpdate! And most strange it return -2 only on some comps.
BTW, there http://ge.tt/814suww are log files and DxDiag files with comp configuration. Files xiaose_* are from my comp where everything is OK. Files jt_* are from another comp where I got error code -2.
and I see no another instances of wyUpdate.exe running it that time...
TXDenis
Solved.
for some reason when I run QProcess::execute(appUpdater) without params it gives me error -2 but when I add '/errno' - it's works as it must be.
So, if we starts wyUpdater in a new process, waits for it to finish, and then returns the exit code of the process - in that case wyUpdater must be started only with some arguments.