InstallNow()

Against all the recommendations you put in the forum I have chosen to use the AutomaticUpdaterBackend in my winforms control.

However InstallNow() is only working the second time the program loads. The program never closes the first time.

I use:

Core.Common.Updater.AutomaticUpdaterBackend.ReadyToBeInstalled += AutomaticUpdaterReadyToBeInstalled;

void ProcessAutomaticUpdaterReadyToBeInstalled(object sender, EventArgs e) { Core.Common.Updater.AutomaticUpdaterBackend.InstallNow(); }

I thought it should the UI and set off the updater, however it never happens, and the second time round it always starts the updater before its finsihed closing the application?

it seems that my mistake was removing the hook to the function

Core.Common.Updater.AutomaticUpdaterBackend.ReadyToBeInstalled -= AutomaticUpdaterReadyToBeInstalled;

..as actually my function looked like this:

void ProcessAutomaticUpdaterReadyToBeInstalled(object sender, EventArgs e){Core.Common.Updater.AutomaticUpdaterBackend.ReadyToBeInstalled -= AutomaticUpdaterReadyToBeInstalled;Core.Common.Updater.AutomaticUpdaterBackend.InstallNow();}

once i removed the hook for some reason this stopped the installNow working, I wonder if thats a bug on you side.

Also still seeing that the updater is not closing our application until after 2/3 seconds, so the user is told to to force close, then the application closes and the updater reloads the application, but why does the updater not launch after the application has closed proper, why launch the updater, then show the close dialog, then suddently the application closes?

You didn't post enough code for me to know what the actial problem is. Removing the event handler for the ReadyToBeInstalled event function shouldn't cause a problem. But I'm not even sure why you want to do that.

A good bit of example code to look at is in the AutomaticUpdater source code. In fact the "AutomaticUpdater" control is just a visual wrapper over the "AutomaticUpdaterBackend" class. Get the source code here.

Also, you should close as much as your application as you can before you call "InstallNow()". That is, you should spin down any running threads and cleanup resources. Then, at the last possible moment, call InstallNow() and exit your app quickly.

Again, this is covered in the source code. We'll have to make some articles showing how to do this.

Does this help at all?