Update from Service not shutting down application

I'm evaluating wyUpdate and so far it's been excellent however i have 1 issue

My application consists of a windows service which does all the main work, and a GUI "Tray" application that allows users to interact with the service and do some other stuff.

I've implemented the "/fromservice" update function and this appears to be working from within my service however i've noticed that if the GUI application is running, it just hangs and keeps waiting forever to finish the update. If i manually exit the GUI then my service picks up the latest version and runs the update without a problem.

Running the standalone wybuild.exe i noticed that it detects and terminates the service as well as the gui app, however it appears that /fromservice does not do this.

Any advise would be appreciated, i tried killing the process for my gui app before starting the /fromservice option but that didn't work either, it just left my app in an unstable state with missing .exe files 🤔

I've implemented the "/fromservice" update function and this appears to be working from within my service however i've noticed that if the GUI application is running, it just hangs and keeps waiting forever to finish the update. If i manually exit the GUI then my service picks up the latest version and runs the update without a problem.

wyUpdate doesn't wait forever, it just waits for something like 2 minutes before cancelling the update and rolling back to the previous state if any changes were made.

Running the standalone wybuild.exe i noticed that it detects and terminates the service as well as the gui app, however it appears that /fromservice does not do this.

Running wyUpdate.exe by double clicking it you'll see there's a popup dialog if you have any apps open. That is, wyUpdate will give you the option of killing your running processes. In the service mode (i.e. using /fromservice) obviously we can't show a popup dialog to the user.

Any advise would be appreciated, i tried killing the process for my gui app before starting the /fromservice option but that didn't work either, it just left my app in an unstable state with missing .exe files

You have to close all your running processes from the service that calls wyUpdate. Then call wyUpdate.exe /fromservice. (Obviously you should close the service process that launches wyUpdate -- let wyUpdate handle that by using the "stop and start service update actions).

Tell me if this helps.

Thank you for the reply,

Based on your response, i think the problem i have is that after the 2 minutes timeout you mentioned, it never terminated the GUI part of my program so the update keeps rolling back.

Can you please tell me if there is way to log the steps and determine the reason why the update process does not properly terminate the GUI application, as part of its update process.

I have worked around the issue by 1. Searching for all running instances of my GUI process (it can be run simultaneously by multiple logged on users, but only a single instance for each user) and killing them all.

2. Starting update process with /fromservice in my service.

This workaround appears to have worked but i would like to know if it's recommended or not.

Thanks againKhalid 🙂

Based on your response, i think the problem i have is that after the 2 minutes timeout you mentioned, it never terminated the GUI part of my program so the update keeps rolling back.

Yes, see: -logfile="<filename>".

Can you please tell me if there is way to log the steps and determine the reason why the update process does not properly terminate the GUI application, as part of its update process.

wyUpdate won't terminate your app. This is by design. You have to terminate your app.

This workaround appears to have worked but i would like to know if it's recommended or not.

That will work.

Excellent. Thank you. You have a new customer. 😀