Always check for updates on startup
- Issue MatterHackers/MCCentral#4607 Clean install does not check for updates
This commit is contained in:
parent
34288ff48d
commit
afeabf3f8a
1 changed files with 4 additions and 17 deletions
|
|
@ -348,23 +348,10 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
private UpdateControlData()
|
||||
{
|
||||
CheckVersionStatus();
|
||||
if (ApplicationSettings.Instance.GetClientToken() != null
|
||||
|| OemSettings.Instance.CheckForUpdatesOnFirstRun)
|
||||
{
|
||||
//If we have already requested an update once, check on load
|
||||
CheckForUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationSession firstSession;
|
||||
firstSession = Datastore.Instance.dbSQLite.Table<ApplicationSession>().OrderBy(v => v.SessionStart).Take(1).FirstOrDefault();
|
||||
if (firstSession != null
|
||||
&& DateTime.Compare(firstSession.SessionStart.AddDays(7), DateTime.Now) < 0)
|
||||
{
|
||||
SetUpdateStatus(UpdateStatusStates.UpdateAvailable);
|
||||
}
|
||||
}
|
||||
this.CheckVersionStatus();
|
||||
|
||||
// Always check for updates on startup
|
||||
this.CheckForUpdate();
|
||||
|
||||
// Now that we are running, check for an update every 24 hours.
|
||||
var checkUpdatesDaily = new System.Timers.Timer(24 * 60 * 60 * 1000); //one day in milliseconds
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue