diff --git a/windows/src/desktop/kmshell/main/Keyman.System.RemoteUpdateCheck.pas b/windows/src/desktop/kmshell/main/Keyman.System.RemoteUpdateCheck.pas index df892929f0..55dde4eb1a 100644 --- a/windows/src/desktop/kmshell/main/Keyman.System.RemoteUpdateCheck.pas +++ b/windows/src/desktop/kmshell/main/Keyman.System.RemoteUpdateCheck.pas @@ -239,9 +239,8 @@ begin begin Exit; end; - if Registry.ValueExists(SRegValue_LastUpdateCheckTime) and - (Now - Registry.ReadDateTime(SRegValue_LastUpdateCheckTime) > - CheckPeriod) then + if (not Registry.ValueExists(SRegValue_LastUpdateCheckTime)) or + ((Now - Registry.ReadDateTime(SRegValue_LastUpdateCheckTime)) > CheckPeriod) then begin Result := True; end; diff --git a/windows/src/desktop/kmshell/main/UfrmMain.pas b/windows/src/desktop/kmshell/main/UfrmMain.pas index 86df47ec70..394cb09377 100644 --- a/windows/src/desktop/kmshell/main/UfrmMain.pas +++ b/windows/src/desktop/kmshell/main/UfrmMain.pas @@ -188,7 +188,7 @@ uses MessageIdentifiers, Keyman.System.ExecutionHistory, Keyman.System.KeymanSentryClient, - Keyman.System.RemoteUpdateCheck, + Keyman.System.UpdateStateMachine, OptionsXMLRenderer, Keyman.Configuration.System.UmodWebHttpServer, Keyman.Configuration.System.HttpServer.App.ConfigMain, @@ -800,16 +800,14 @@ begin end; procedure TfrmMain.Update_CheckNow; -// TODO: epic-windows-update -// Get an instance to the state machine and call handle check so the state can change to update -// available. -var UpdateCheck : TRemoteUpdateCheck; +var + BUpdateSM : TUpdateStateMachine; begin - UpdateCheck := TRemoteUpdateCheck.Create(True); + BUpdateSM := TUpdateStateMachine.Create(False); try - UpdateCheck.Run; + BUpdateSM.HandleCheck; finally - UpdateCheck.Free; + BUpdateSM.Free; end; DoRefresh; end;