Check for updates on a time interval with AutomaticUpdater i

Hello,

If I'm using AutomaticUpdater in a WPF app, is there an easy way to have it check for available updates automatically every fifteen minutes or so?

I tried the approach described in this post :https://wyday.com/forum/t/390/calling-installnow-in-code-throws-an-error/#post-1972

but it doesn't allow me to alert the user as soon as there's an update available, like I thought it would. It shows my alert box at startup, but I want it to check on a time interval.

So I tried a simple approach with a DispatcherTimer:

-----------------------------------------------------------------In MainWindow constructor------------------------------------------------------------------DispatcherTimer timer = new DispatcherTimer();timer.Tick +=new EventHandler(timer_Tick);timer.Interval = new TimeSpan(0, 0, 10);timer.Start();

---------------------------------------------------------------------Tick Event Handler---------------------------------------------------------------------private void timer_Tick(object sender, EventArgs e){ if (automaticUpdater1.ForceCheckForUpdate()) { if (MessageBox.Show("An update is available. Would you like to download this update now?", "Update Available", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes) automaticUpdater1.InstallNow(); }}

However, the ForceCheckForUpdate returns true even when no updates are available, resulting in an error. Am I misunderstanding the ForceCheckForUpdate method? Is there an entirely easier way to do this?

Am I misunderstanding the ForceCheckForUpdate method?

Yes, you are. The ForceCheckForUpdate method returns true if it has begun checking -- not if there are updates available. Use the UpdateAvailable event to notify the user.