AutomaticUpdater API problems

Hi,While I was trying to work with your API I encountered some problems.1. Windows service doesn't stop when update is ready to be installed even though I added the proper action to stop the service before installing the update.Scenario:a. In WyBuild app add an action to stop the service before installing the patch.b. When update is ready to be installed (after downloading and extracting) I call on the function "installNow()" I can see that AutomaticUpdaterBackend is calling the CloseAppNow callback.The problem:The service doesn't close after that.My solution:Im "helping" the process to close the windows service. This means that when the CloseAppNow is called, inside the callback I call the ServiceBase.Stop() function.

2. Windows service does stop when update is ready to be installed. The stopping of the service is done by the proper action to stop the service before installing the update but when the service is restarted after the install I get "installFailed".Scenario:a. In WyBuild app add an action to stop the windows service before installing the patch.b. In WyBuild app add an action to start the windows service after installing the patch.c. When update is ready to be installed (after downloading and extracting) I call on the function "installNow()" I can see that AutomaticUpdaterBackend is calling the CloseAppNow callback.And the windows service stops.d. The service is restarted The problem:Im notified the update process failed.My solution: I noticed that the service was indeed stopped but the process that the service runs (my application) was still running. it seems that it takes the process several seconds to close after the windows service that runs it is stopped.If I were to stop the service myself I could have waited several seconds for the application process to close as well and then issue the update.Since im using actions in AutomaticUpdater to stop and restart the service (and as a consequence my application that it is running) I can't specify a time to wait before restarting the service.My only other option was to kill the process myself in the OnStop() function of the Service.Only after that the update succeeds.

My questions:1. Are you aware of these problems?2. Were the solutions I proposed valid? (meaning do they agree with the valid flow of the AutomaticUpdater program)

Thanks,Shlomi

Hey Shlomi,

Im "helping" the process to close the windows service. This means that when the CloseAppNow is called, inside the callback I call the ServiceBase.Stop() function.

If you handle the CloseAppNow event (that is, you have an event attached) then you must also handle the closing of your service. Otherwise the AutomaticUpdater handle this by calling Environment.Exit(0);

My only other option was to kill the process myself in the OnStop() function of the Service.Only after that the update succeeds.

Yes, wyUpdate requires your apps to be closed before proceeding with the update. When wyUpdate is installing from a service (i.e. no user interface) then wyUpdate waits a fixed amount of time (less than a minute) for apps to close themselves. If they don't close then wyUpdate aborts and rollsback the update.

1. Are you aware of these problems?

These aren't really problems. You have to handle them, yes, but they're specific to your app. Perhaps we should make this clearer in our help articles.

2. Were the solutions I proposed valid? (meaning do they agree with the valid flow of the AutomaticUpdater program)

They look valid to me.