mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-06 00:45:32 +00:00
There was some dead code from before the RemoteUpdateCheck refactor was created. This is removed in this commit
52 lines
981 B
ObjectPascal
52 lines
981 B
ObjectPascal
{
|
|
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.
|