27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
-
+
-
+
-
+
-
+
-
+
-
+
-
+
|
{ TBuildStatusWindow }
TBuildStatusWindow = class(TForm)
Label1: TLabel;
private
public
function BuildDocument(CommandLine: String; LogFile: String): Boolean;
function BuildDocument(CommandLine: string; LogFile: string): boolean;
end;
var
OutputText: String;
OutputText: string;
implementation
{$R *.lfm}
function TBuildStatusWindow.BuildDocument(CommandLine: String; LogFile: String): Boolean;
function TBuildStatusWindow.BuildDocument(CommandLine: string; LogFile: string): boolean;
var
str: String;
str: string;
lh: TextFile;
ret: Boolean;
ret: boolean;
begin
{$IFDEF WINDOWS}
{$IFDEF WINDOWS}
ret := RunCommand('cmd', ['/c', CommandLine], str, [], swoHIDE);
{$ELSE}
ret := RunCommand('sh', ['-c', CommandLine], str, [], swoHIDE);
{$ENDIF}
{$ENDIF}
if Length(str) = 0 then str := 'No problems have occurred. :-)';
if LogFile <> '' then
begin
AssignFile(lh, LogFile);
try
|