|
@@ -33,6 +33,7 @@ interface
|
|
|
{$DEFINE OS_FILESETDATEBYNAME}
|
|
|
{$DEFINE HAS_SLEEP}
|
|
|
{$DEFINE HAS_OSERROR}
|
|
|
+{$DEFINE HAS_TEMPDIR}
|
|
|
|
|
|
{OS has only 1 byte version for ExecuteProcess}
|
|
|
{$define executeprocuni}
|
|
@@ -917,6 +918,23 @@ begin
|
|
|
end;
|
|
|
|
|
|
|
|
|
+function GetTempDir(Global: Boolean): string;
|
|
|
+begin
|
|
|
+ if Assigned(OnGetTempDir) then
|
|
|
+ Result := OnGetTempDir(Global)
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ Result := GetEnvironmentVariable('TEMP');
|
|
|
+ if Result = '' Then
|
|
|
+ Result:=GetEnvironmentVariable('TMP');
|
|
|
+ if Result = '' then
|
|
|
+ Result := 'T:'; // fallback.
|
|
|
+ end;
|
|
|
+ if Result <> '' then
|
|
|
+ Result := IncludeTrailingPathDelimiter(Result);
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
{****************************************************************************
|
|
|
Initialization code
|
|
|
****************************************************************************}
|