-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(windows): add state machine to control installation including apply now update 💽 #12079
Merged
rc-swag
merged 55 commits into
epic/windows-updates
from
feat/windows/add-apply-now-update
Nov 12, 2024
Merged
Changes from 50 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
e83b002
feat(windows): WIP buc sm doesn't build just backup
rc-swag 947b829
feat(windows): WIP
rc-swag dee525f
chore(windows): Merge branch 'feat/windows/remove-ui-com-onlineupdate…
rc-swag bca5329
feat(windows): WIP merge sm
rc-swag 6cb8398
feat(windows): WIP added keyman has run atom
rc-swag dd5767a
feat(windows): integrate sm states and handlekmshell
rc-swag 486586d
feat(windows): apply now install for state machine
rc-swag 2eab485
feat(windows): Add a installNow event to SM
rc-swag 2a6a743
chore(windows): Merge branch 'epic/windows-updates' into feat/windows…
rc-swag 3dc3a25
feat(windows): remove stub comments
rc-swag f7744f9
feat(windows): mark outstanding issues with feature
rc-swag 8454285
chore(windows): Merge branch 'feat/windows/add-state-machine-o-update…
rc-swag e29e212
feat(windows): WIP - leave commit so work not lost
rc-swag db18917
feat(windows): project file listing updated
rc-swag 29b54ad
chore(windows): Merge branch 'epic/windows-updates' into feat/windows…
rc-swag 47d3d26
chore(windows): Merge branch 'epic/windows-updates' into feat/windows…
rc-swag 14310a1
feat(windows): rename files to new delphi pattern
rc-swag a9fd916
feat(windows): small refactor of sm wip
rc-swag bf2d8f9
chore(windows): Merge branch 'epic/windows-updates' into feat/windows…
rc-swag d6258e5
feat(windows): add checkconfig for updated download
rc-swag 9f72feb
feat(windows): merge conflicts wip
rc-swag b0cdcab
feat(windows): correct error checking for has keyman run
rc-swag c86ecfd
feat(windows): use CU registry key for statemachine state
rc-swag a7736a0
feat(windows): remove duplicate localisation string id
rc-swag 98cd1f5
feat(windows): add handledownload back in
rc-swag 6a305c1
feat(windows): remove uneeded registry keys
rc-swag 50a56c9
chore(windows): Merge branch 'epic/windows-updates' into feat/windows…
rc-swag e2ec08c
feat(windows): remove klogging enable
rc-swag 4c1aa0f
feat(windows): add basic modal install form
rc-swag 8df507d
feat(windows): add menuframe_update image 4 config
rc-swag 7860ddc
feat(windows): add update to strings.xml
rc-swag 1667cfe
feat(windows): clean up ready for review
rc-swag 85a998b
feat(windows): rename executehistory module for clarity
rc-swag cb341d9
chore(windows): Merge branch 'feat/windows/add-apply-now-update' into…
rc-swag eff8a88
feat(windows): resize and add title for install now
rc-swag bfe1b45
feat(windows): automatic updates option to config reg
rc-swag 4c48408
Merge pull request #12375 from keymanapp/feat/windows/automatic-updat…
rc-swag 1acf0d0
Merge pull request #12353 from keymanapp/feat/windows/install-now-pop-up
rc-swag 033cb22
feat(windows): changes update form now
rc-swag 3f1236a
feat(windows): comments copyright formating
rc-swag 5c187db
feat(windows): address review comments
rc-swag 06de2b0
feat(windows): change automatic update description
rc-swag 4ad5f0f
chore(windows): Merge branch 'epic/windows-updates' into feat/windows…
rc-swag b4f52be
feat(windows): rename UI forms to convention
rc-swag c988271
feat(windows): formatting review suggestions
rc-swag ac38649
feat(windows): More formatting fixes.
rc-swag 141bfda
feat(windows): remove redundant time since last update
rc-swag 3cf1fe5
feat(windows): use FStateInstance array instead
rc-swag f2d0e26
feat(windows): remove TUpdateStateMachineParams
rc-swag 544b955
feat(windows): add error checking - private class
rc-swag 7be490a
feat(windows): review comment suggestions
rc-swag e239ec7
feat(windows): Review comments
rc-swag 79a23a7
chore(windows): Merge branch 'epic/windows-updates' into feat/windows…
rc-swag 883092e
feat(windows): fix installHelper
rc-swag ab3227f
feat(windows): review comments
rc-swag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
common/windows/delphi/general/Keyman.System.ExecutionHistory.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
Keyman is copyright (C) SIL Global. MIT License. | ||
|
||
This module provides functionality to track the execution state of the Keyman | ||
engine. It uses a global atom to record whether Keyman has started during the | ||
current session and checks if it has previously run. | ||
} | ||
unit Keyman.System.ExecutionHistory; | ||
|
||
|
||
interface | ||
|
||
const | ||
AtomName = 'KeymanSessionFlag'; | ||
|
||
function RecordKeymanStarted : Boolean; | ||
function HasKeymanRun : Boolean; | ||
|
||
implementation | ||
|
||
uses | ||
System.SysUtils, | ||
Winapi.Windows, | ||
KLog; | ||
|
||
function RecordKeymanStarted : Boolean; | ||
var | ||
atom: WORD; | ||
begin | ||
atom := GlobalAddAtom(AtomName); | ||
if atom = 0 then | ||
begin | ||
// TODO-WINDOWS-UPDATES: #10210 log to sentry | ||
Result := False; | ||
end | ||
else | ||
Result := True; | ||
end; | ||
|
||
function HasKeymanRun : Boolean; | ||
begin | ||
Result := GlobalFindAtom(AtomName) <> 0; | ||
if not Result then | ||
begin | ||
if GetLastError <> ERROR_FILE_NOT_FOUND then | ||
begin | ||
// TODO-WINDOWS-UPDATES: log to Sentry | ||
end; | ||
end; | ||
end; | ||
|
||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
11 changes: 11 additions & 0 deletions
11
windows/src/desktop/kmshell/main/BackgroundUpdateStateDiagram.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
``` mermaid | ||
stateDiagram | ||
[*] --> Idle | ||
Idle --> UpdateAvailable | ||
UpdateAvailable --> Downloading | ||
Downloading --> Installing | ||
Downloading --> WaitingRestart | ||
WaitingRestart --> Installing | ||
Installing --> PostInstall | ||
PostInstall --> Idle | ||
``` |
47 changes: 47 additions & 0 deletions
47
windows/src/desktop/kmshell/main/Keyman.Configuration.UI.UfrmStartInstall.dfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
object frmStartInstall: TfrmStartInstall | ||
Left = 0 | ||
Top = 0 | ||
Caption = 'Keyman Update' | ||
ClientHeight = 225 | ||
ClientWidth = 425 | ||
Color = clBtnFace | ||
Font.Charset = DEFAULT_CHARSET | ||
Font.Color = clWindowText | ||
Font.Height = -11 | ||
Font.Name = 'Tahoma' | ||
Font.Style = [] | ||
OldCreateOrder = False | ||
PixelsPerInch = 96 | ||
TextHeight = 13 | ||
object lblInstallUpdate: TLabel | ||
Left = 128 | ||
Top = 96 | ||
Width = 175 | ||
Height = 19 | ||
Caption = 'Keyman update available' | ||
Font.Charset = DEFAULT_CHARSET | ||
Font.Color = clWindowText | ||
Font.Height = -16 | ||
Font.Name = 'Tahoma' | ||
Font.Style = [] | ||
ParentFont = False | ||
end | ||
object cmdInstall: TButton | ||
Left = 228 | ||
Top = 184 | ||
Width = 75 | ||
Height = 25 | ||
Caption = 'Install' | ||
ModalResult = 1 | ||
TabOrder = 0 | ||
end | ||
object cmdLater: TButton | ||
Left = 336 | ||
Top = 184 | ||
Width = 75 | ||
Height = 25 | ||
Caption = 'Close' | ||
ModalResult = 8 | ||
TabOrder = 1 | ||
end | ||
end |
39 changes: 39 additions & 0 deletions
39
windows/src/desktop/kmshell/main/Keyman.Configuration.UI.UfrmStartInstall.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
Keyman is copyright (C) SIL Global. MIT License. | ||
|
||
// TODO-WINDOWS-UPDATES: Localise all the labels and captions. | ||
} | ||
unit Keyman.Configuration.UI.UfrmStartInstall; | ||
interface | ||
|
||
uses | ||
System.Classes, | ||
System.SysUtils, | ||
System.Variants, | ||
Vcl.Controls, | ||
Vcl.Dialogs, | ||
Vcl.ExtCtrls, | ||
Vcl.Forms, | ||
Vcl.Graphics, | ||
Vcl.StdCtrls, | ||
Winapi.Messages, | ||
Winapi.Windows, | ||
UfrmKeymanBase, | ||
UserMessages; | ||
|
||
type | ||
TfrmStartInstall = class(TfrmKeymanBase) | ||
cmdInstall: TButton; | ||
cmdLater: TButton; | ||
lblInstallUpdate: TLabel; | ||
private | ||
public | ||
end; | ||
|
||
|
||
implementation | ||
|
||
{$R *.dfm} | ||
|
||
|
||
end. |
61 changes: 61 additions & 0 deletions
61
windows/src/desktop/kmshell/main/Keyman.Configuration.UI.UfrmStartInstallNow.dfm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
object frmStartInstallNow: TfrmStartInstallNow | ||
Left = 0 | ||
Top = 0 | ||
Caption = 'Keyman Update' | ||
ClientHeight = 225 | ||
ClientWidth = 425 | ||
Color = clBtnFace | ||
Font.Charset = DEFAULT_CHARSET | ||
Font.Color = clWindowText | ||
Font.Height = -11 | ||
Font.Name = 'Tahoma' | ||
Font.Style = [] | ||
OldCreateOrder = False | ||
PixelsPerInch = 96 | ||
TextHeight = 13 | ||
object lblUpdateMessage: TLabel | ||
Left = 56 | ||
Top = 88 | ||
Width = 274 | ||
Height = 19 | ||
Caption = 'Keyman and Windows will be restarted' | ||
Font.Charset = DEFAULT_CHARSET | ||
Font.Color = clWindowText | ||
Font.Height = -16 | ||
Font.Name = 'Tahoma' | ||
Font.Style = [] | ||
ParentFont = False | ||
WordWrap = True | ||
end | ||
object lblUpdateNow: TLabel | ||
Left = 56 | ||
Top = 40 | ||
Width = 115 | ||
Height = 25 | ||
Caption = 'Update Now' | ||
Font.Charset = DEFAULT_CHARSET | ||
Font.Color = clWindowText | ||
Font.Height = -21 | ||
Font.Name = 'Tahoma' | ||
Font.Style = [] | ||
ParentFont = False | ||
end | ||
object cmdInstall: TButton | ||
Left = 228 | ||
Top = 184 | ||
Width = 75 | ||
Height = 25 | ||
Caption = 'Update' | ||
ModalResult = 1 | ||
TabOrder = 0 | ||
end | ||
object cmdLater: TButton | ||
Left = 336 | ||
Top = 184 | ||
Width = 75 | ||
Height = 25 | ||
Caption = 'Close' | ||
ModalResult = 8 | ||
TabOrder = 1 | ||
end | ||
end |
40 changes: 40 additions & 0 deletions
40
windows/src/desktop/kmshell/main/Keyman.Configuration.UI.UfrmStartInstallNow.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
Keyman is copyright (C) SIL Global. MIT License. | ||
|
||
// TODO-WINDOWS-UPDATES: Localise all the labels and captions. | ||
} | ||
unit Keyman.Configuration.UI.UfrmStartInstallNow; | ||
interface | ||
|
||
uses | ||
System.Classes, | ||
System.SysUtils, | ||
System.Variants, | ||
Vcl.Controls, | ||
Vcl.Dialogs, | ||
Vcl.ExtCtrls, | ||
Vcl.Forms, | ||
Vcl.Graphics, | ||
Vcl.StdCtrls, | ||
Winapi.Messages, | ||
Winapi.Windows, | ||
UfrmKeymanBase, | ||
UserMessages; | ||
|
||
type | ||
TfrmStartInstallNow = class(TfrmKeymanBase) | ||
cmdInstall: TButton; | ||
cmdLater: TButton; | ||
lblUpdateMessage: TLabel; | ||
lblUpdateNow: TLabel; | ||
private | ||
public | ||
end; | ||
|
||
implementation | ||
|
||
{$R *.dfm} | ||
|
||
|
||
|
||
end. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this file should be committed