mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-11 19:35:32 +00:00
feat(windows): check update use statemachine
Also the first time remoteupdate check config runs it needs to return true if the 'last update time' registry entry does not exist.
This commit is contained in:
parent
7deb248c1e
commit
2467e1dd1f
2 changed files with 8 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue