I forgot to say that the lock up occurs on application startup.
Ok, I think everything is getting into place now.
I'm having one last issue.
AutomaticUpdater is on the main form. It is configured with UpdateType = DoNothing. I've also tried this with UpdateType = Automatic and the behaviour is the same.
I've got this code on the main form Shown event (I've tried it on the Load event and the behavior is also the same):
automaticUpdater.ForceCheckForUpdate();
Then, on the AutomaticUpdater.UpdateAvailable event, I've got this:
automaticUpdater.InstallNow();
It works up to the point where AutomaticUpdater says it will update on the next app restart. Then it locks up. I've tried this multiple times, with different options, and it always locks up. When it locks up the running processes are: my application and InstantUpdate.com.Funny thing is that if I select to "Install update now" when the "Update will be installed on next start" message appears, it all goes as expected, as with running the wyUpdate.exe outside my app.
What I'm trying to accomplish is to automatically perform the update with the least intervention from the user, but I don't understand why it locks.
What I'm trying to accomplish is to automatically perform the update with the least intervention from the user, but I don't understand why it locks.
If you want the AutomaticUpdater to update with the least user intervention then just set UpdateType to Automatic. There's no need to call either ForceCheckForUpdate or InstallNow.
AutomaticUpdater will handle all of that for you. Just use the "WaitBeforeCheckSecs" property to set how long after the app has started to check for updates. Use the "DaysBetweenChecks" to configure how often the AutomaticUpdater should check for updates.
As for why it's hanging, I'm not sure. I'll look into it. But if you use the method I describe above then it shouldn't hang.
I've done that before, but it did absolutely nothing. I tried it with DaysBetweenChecks set to 1 and WaitBeforeCheckSecs set to 5.I've now set DaysBetweenChecks to 0, and wyUpdate launched a couple of seconds after app startup, before showing the main form.
Where does it store the last check? Probably, automatic wasn't working because DaysBetweenChecks was set to 1 and it already checked today.
Thanks for your help. Guess everything's working now!
Where does it store the last check?
%appdata%\wyUpdate AU\
In that folder you'll find a file with a GUID that matches the one you set for your AutomaticUpdater control.
Probably, automatic wasn't working because DaysBetweenChecks was set to 1 and it already checked today.
Yes, that's exactly it.
Thanks for your help. Guess everything's working now!
No problem at all.