@@ -5,7 +5,8 @@ interface
55uses
66 DOSCommand, OpenToolApi.CommandMessage;
77
8- function Runner (ACommand, APath: string): Cardinal;
8+ function Runner (APath, ACommand: string): Integer; overload;
9+ function Runner (ACommand: string): Integer; overload;
910
1011implementation
1112
@@ -15,33 +16,41 @@ implementation
1516var
1617 FMonitorLock: TObject;
1718
18- function Runner (ACommand, APath : string): Cardinal ;
19+ function DoRunner (APath, ACommand : string): Integer ;
1920var
2021 LDosCommand: TDosCommand;
2122begin
22- System.TMonitor.Enter(FMonitorLock);
23+ // System.TMonitor.Enter(FMonitorLock);
2324 try
2425 LDosCommand := TDosCommand.Create(nil );
2526 try
26- LDosCommand.InputToOutput := False;
27+ // LDosCommand.InputToOutput := False;
2728 LDosCommand.CurrentDir := APath;
2829 LDosCommand.CommandLine := ACommand;
2930 LDosCommand.Execute;
3031
3132 while LDosCommand.IsRunning do
3233 begin
3334 Application.ProcessMessages;
34- Sleep(0 );
3535 end ;
3636
37- Result := LDosCommand.ExitCode
38-
37+ Result := LDosCommand.ExitCode;
3938 finally
4039 LDosCommand.Free;
4140 end ;
4241 finally
43- System.TMonitor.Exit(FMonitorLock);
42+ // System.TMonitor.Exit(FMonitorLock);
4443 end ;
4544end ;
4645
46+ function Runner (ACommand: string): Integer;
47+ begin
48+ Result := DoRunner(' C:/' , ACommand);
49+ end ;
50+
51+ function Runner (APath, ACommand: string): Integer;
52+ begin
53+ Result := DoRunner(APath, ACommand);
54+ end ;
55+
4756end .
0 commit comments