spiegel-keyman/developer/src/tike/main/Keyman.Developer.System.KeymanDeveloperPaths.pas
Marc Durdin 268ba98219 feat(developer): Support new touch layout definitions in Delphi
Also minor tweaks to allow jquery-ui images to load, fixup for broken
file path for node.exe.
2022-07-14 10:55:01 +10:00

68 lines
1.5 KiB
ObjectPascal

unit Keyman.Developer.System.KeymanDeveloperPaths;
interface
uses
System.SysUtils,
KeymanPaths;
type
TKeymanDeveloperPaths = class sealed
private
public
class function NodePath: string; static;
const S_LexicalModelCompiler = 'kmlmc.cmd';
class function LexicalModelCompilerPath: string; static;
const S_ServerConfigJson = 'config.json';
class function ServerDataPath: string; static;
class function ServerPath: string; static;
end;
implementation
uses
Winapi.ShlObj,
RegistryKeys,
utilsystem;
{ TKeymanDeveloperPaths }
class function TKeymanDeveloperPaths.NodePath: string;
var
KeymanRoot: string;
begin
if TKeymanPaths.RunningFromSource(KeymanRoot)
then Result := KeymanRoot + 'developer\src\inst\node\dist\node.exe'
else Result := ExtractFilePath(ParamStr(0)) + 'node.js\node.exe';
end;
class function TKeymanDeveloperPaths.ServerDataPath: string;
begin
Result := GetFolderPath(CSIDL_APPDATA) + SFolderKeymanDeveloper + '\server\';
end;
class function TKeymanDeveloperPaths.ServerPath: string;
var
KeymanRoot: string;
begin
if TKeymanPaths.RunningFromSource(KeymanRoot)
then Result := KeymanRoot + 'developer\src\server\'
else Result := ExtractFilePath(ParamStr(0)) + 'server\';
end;
class function TKeymanDeveloperPaths.LexicalModelCompilerPath: string;
var
KeymanRoot: string;
begin
if TKeymanPaths.RunningFromSource(KeymanRoot)
then Result := KeymanRoot + 'developer\src\tike\'
else Result := ExtractFilePath(ParamStr(0));
Result := Result + S_LexicalModelCompiler;
end;
end.