private void CheckForUpdates()
{
while (true)
{
try
{
log.Debug("Checking for updates.");
UpdateInfo updateInfo = updateManager.CheckForUpdate();
if (updateInfo.HasUpdate)
{
log.Debug("Updates found. Installing new files.");
updateManager.DoUpdate(updateInfo);
log.Debug("Update is ready.");
RaiseUpdated();
}
else
{
log.Debug("No updates found.");
}
}
catch (ThreadAbortException)
{
throw;
}
catch (Exception err)
{
log.Error(err.Message);
}
Thread.Sleep(secondsBetweenChecks * 1000);
}
}