chore(windows): Merge branch 'feat/windows/add-apply-now-update' into feat/windows/install-now-pop-up

This commit is contained in:
rc-swag 2024-09-03 15:43:05 +10:00
commit cb341d985a
12 changed files with 27 additions and 25 deletions

View file

@ -1,4 +1,12 @@
unit Keyman.System.ExecuteHistory;
unit Keyman.System.ExecutionHistory;
{
Copyright: © SIL International.
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.
}
interface
@ -25,7 +33,6 @@ begin
if GetLastError <> ERROR_FILE_NOT_FOUND then
RaiseLastOSError;
atom := GlobalAddAtom(AtomName);
KL.Log('RecordKeymanStarted: True');
Result := True;
if atom = 0 then
RaiseLastOSError;
@ -47,13 +54,10 @@ begin
begin
if GetLastError <> ERROR_SUCCESS then
RaiseLastOSError;
KL.Log('HasKeymanRun: Keyman Has Run');
Result := True;
end
else
begin
KL.Log('HasKeymanRun: Keyman Has Run');
Result := False;
end;

View file

@ -162,7 +162,6 @@ const
SRegKey_KeymanDesktop_CU = SRegKey_KeymanDesktopRoot_CU;
SRegKey_KeymanDesktop_LM = SRegKey_KeymanDesktopRoot_LM;
{ Other Keyman Settings }
SRegValue_DeadkeyConversionMode = 'deadkey conversion mode'; // CU // I4552
@ -300,7 +299,6 @@ const
SRegKey_KeymanDeveloperRoot_LM = SRegKey_KeymanRoot_LM + '\Keyman Developer'; // LM CU
SRegKey_KeymanDeveloper_LM = SRegKey_KeymanDeveloperRoot_LM; // LM CU
SRegKey_IDE_CU = SRegKey_KeymanDeveloper_CU + '\IDE'; // CU
SRegKey_IDEDock_CU = SRegKey_IDE_CU + '\Dock'; // CU
SRegKey_IDEFiles_CU = SRegKey_IDE_CU + '\Files'; // CU

View file

@ -183,7 +183,7 @@ uses
Keyman.System.RemoteUpdateCheck in 'main\Keyman.System.RemoteUpdateCheck.pas',
Keyman.System.UpdateStateMachine in 'main\Keyman.System.UpdateStateMachine.pas',
Keyman.System.DownloadUpdate in 'main\Keyman.System.DownloadUpdate.pas',
Keyman.System.ExecuteHistory in '..\..\..\..\common\windows\delphi\general\Keyman.System.ExecuteHistory.pas',
Keyman.System.ExecutionHistory in '..\..\..\..\common\windows\delphi\general\Keyman.System.ExecutionHistory.pas',
UfrmStartInstall in 'main\UfrmStartInstall.pas' {Form1};
{$R VERSION.RES}

View file

@ -359,7 +359,7 @@
<DCCReference Include="main\Keyman.System.RemoteUpdateCheck.pas"/>
<DCCReference Include="main\Keyman.System.UpdateStateMachine.pas"/>
<DCCReference Include="main\Keyman.System.DownloadUpdate.pas"/>
<DCCReference Include="..\..\..\..\common\windows\delphi\general\Keyman.System.ExecuteHistory.pas"/>
<DCCReference Include="..\..\..\..\common\windows\delphi\general\Keyman.System.ExecutionHistory.pas"/>
<DCCReference Include="main\UfrmStartInstall.pas">
<Form>Form1</Form>
<FormType>dfm</FormType>
@ -425,12 +425,6 @@
<Platform value="Win64">False</Platform>
</Platforms>
<Deployment Version="3">
<DeployFile LocalName="bin\Win32\Debug\kmshell.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>kmshell.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="kmshell.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>kmshell.exe</RemoteName>
@ -443,6 +437,12 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="bin\Win32\Debug\kmshell.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>kmshell.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>

View file

@ -6,6 +6,6 @@ stateDiagram
Downloading --> Installing
Downloading --> WaitingRestart
WaitingRestart --> Installing
Installing --> WaitingPostInstall
WaitingPostInstall --> Idle
Installing --> PostInstall
PostInstall --> Idle
```

View file

@ -32,8 +32,8 @@ uses
httpuploader,
Keyman.System.UpdateCheckResponse,
Keyman.System.ExecuteHistory,
UfrmStartInstall,
Keyman.System.ExecutionHistory,
UfrmDownloadProgress;
const

View file

@ -847,8 +847,6 @@ begin
KL.Log('TrmfMain: Executing Update_ApplyNow Failed');
end;
procedure TfrmMain.TntFormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
inherited;

View file

@ -253,6 +253,8 @@ begin
else if s = '-?' then FMode := fmHelpKMShell
else if s = '-h' then FMode := fmHelp
else if s = '-t' then FMode := fmTextEditor
//TODO: will remove -ouc not used
// -buc uses the Statemachine can be used for external scripts to force a check
else if s = '-ouc' then FMode := fmOnlineUpdateCheck
else if s = '-buc' then FMode := fmBackgroundUpdateCheck
else if s = '-bd' then FMode := fmBackgroundDownload

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -695,6 +695,10 @@ keyboard that you use in Windows. Keyman keyboards will adapt automatically to
<!-- Context: Online Update Dialog -->
<!-- String Type: PlainText -->
<!-- Introduced: 18.0.230.0 -->
<string name="S_Update" comment="Update tab name">Update</string>
<!-- Context: Online Update Dialog -->
<!-- String Type: PlainText -->

View file

@ -36,7 +36,6 @@ begin
Result := False;
UpdateStr := 'usPostInstall';
//KL.Log('SetBackgroundState State Entry');
if RegOpenKeyEx(HKEY_LOCAL_MACHINE, PChar(SRegKey_KeymanEngine_CU), 0, KEY_ALL_ACCESS, hk) = ERROR_SUCCESS then
begin
try
@ -54,7 +53,7 @@ begin
end
else
begin
// couldn't open registry key
// TODO: couldn't open registry key
end;
end;

View file

@ -78,11 +78,8 @@ var
hMutex: Cardinal;
begin
KL.Log('Keyman RunProgram');
if not ValidateParameters(FCommand) then Exit;
// TODO set atom application running
KL.Log('Calling RecordKeymanStarted');
RecordKeymanStarted;
hProgramMutex := CreateMutex(nil, False, 'KeymanEXE70');