diff options
Diffstat (limited to '')
-rw-r--r-- | src/classes/UPlatform.pas | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/classes/UPlatform.pas b/src/classes/UPlatform.pas index b71ac1b8..1dcdb5b9 100644 --- a/src/classes/UPlatform.pas +++ b/src/classes/UPlatform.pas @@ -25,6 +25,7 @@ type TDirectoryEntryArray = array of TDirectoryEntry; TPlatform = class + function GetExecutionDir(): string; procedure Init; virtual; function DirectoryFindFiles(Dir, Filter: WideString; ReturnAllSubDirs: boolean): TDirectoryEntryArray; virtual; abstract; function TerminateIfAlreadyRunning(var WndTitle : string): boolean; virtual; @@ -81,6 +82,14 @@ begin System.Halt; end; +{** + * Returns the directory of the executable + *} +function TPlatform.GetExecutionDir(): string; +begin + Result := ExtractFilePath(ParamStr(0)); +end; + (** * Default TerminateIfAlreadyRunning() implementation *) |