|
@@ -60,10 +60,6 @@ function GetFileVersion(const AFileName: string): Cardinal;
|
|
|
|
|
|
procedure GetFormatSettings;
|
|
procedure GetFormatSettings;
|
|
|
|
|
|
-// OS specific versions for windows, to keep redir working
|
|
|
|
-function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString;ExecInheritsHandles:boolean):integer;
|
|
|
|
-function ExecuteProcess(Const Path: AnsiString; Const ComLine: Array of AnsiString;ExecInheritsHandles:boolean):integer;
|
|
|
|
-
|
|
|
|
implementation
|
|
implementation
|
|
|
|
|
|
uses
|
|
uses
|
|
@@ -841,7 +837,7 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
-function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString;ExecInheritsHandles:boolean):integer;
|
|
|
|
|
|
+function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString;Flags:TExecuteFlags=[]):integer;
|
|
// win specific function
|
|
// win specific function
|
|
var
|
|
var
|
|
SI: TStartupInfo;
|
|
SI: TStartupInfo;
|
|
@@ -850,7 +846,7 @@ var
|
|
l : DWord;
|
|
l : DWord;
|
|
CommandLine : ansistring;
|
|
CommandLine : ansistring;
|
|
e : EOSError;
|
|
e : EOSError;
|
|
-
|
|
|
|
|
|
+ ExecInherits : longbool;
|
|
begin
|
|
begin
|
|
FillChar(SI, SizeOf(SI), 0);
|
|
FillChar(SI, SizeOf(SI), 0);
|
|
SI.cb:=SizeOf(SI);
|
|
SI.cb:=SizeOf(SI);
|
|
@@ -869,8 +865,10 @@ begin
|
|
else
|
|
else
|
|
CommandLine := CommandLine + #0;
|
|
CommandLine := CommandLine + #0;
|
|
|
|
|
|
|
|
+ ExecInherits:=ExecInheritsHandles in Flags;
|
|
|
|
+
|
|
if not CreateProcess(nil, pchar(CommandLine),
|
|
if not CreateProcess(nil, pchar(CommandLine),
|
|
- Nil, Nil, ExecInheritsHandles,$20, Nil, Nil, SI, PI) then
|
|
|
|
|
|
+ Nil, Nil, ExecInherits,$20, Nil, Nil, SI, PI) then
|
|
begin
|
|
begin
|
|
e:=EOSError.CreateFmt(SExecuteProcessFailed,[CommandLine,GetLastError]);
|
|
e:=EOSError.CreateFmt(SExecuteProcessFailed,[CommandLine,GetLastError]);
|
|
e.ErrorCode:=GetLastError;
|
|
e.ErrorCode:=GetLastError;
|
|
@@ -894,13 +892,7 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString):integer;
|
|
|
|
-// os independant function
|
|
|
|
-begin
|
|
|
|
- result:=Executeprocess(path,comline,false);
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-function ExecuteProcess(Const Path: AnsiString; Const ComLine: Array of AnsiString;ExecInheritsHandles:boolean):integer;
|
|
|
|
|
|
+function ExecuteProcess(Const Path: AnsiString; Const ComLine: Array of AnsiString;Flags:TExecuteFlags=[]):integer;
|
|
|
|
|
|
var
|
|
var
|
|
CommandLine: AnsiString;
|
|
CommandLine: AnsiString;
|
|
@@ -913,13 +905,7 @@ begin
|
|
CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'
|
|
CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'
|
|
else
|
|
else
|
|
CommandLine := CommandLine + ' ' + Comline [I];
|
|
CommandLine := CommandLine + ' ' + Comline [I];
|
|
- ExecuteProcess := ExecuteProcess (Path, CommandLine,ExecInheritsHandles);
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
-function ExecuteProcess(Const Path: AnsiString; Const ComLine: Array of AnsiString):integer;
|
|
|
|
-// os independant function
|
|
|
|
-begin
|
|
|
|
- result:=Executeprocess(path,comline,false);
|
|
|
|
|
|
+ ExecuteProcess := ExecuteProcess (Path, CommandLine,Flags);
|
|
end;
|
|
end;
|
|
|
|
|
|
Procedure Sleep(Milliseconds : Cardinal);
|
|
Procedure Sleep(Milliseconds : Cardinal);
|