mirror of https://gitlab.com/basile.b/dexed.git
Merge pull request #8 from btbytes/master
Application now compiles on Mac OSX (Yosemite).
This commit is contained in:
commit
9b9fefd0d0
|
@ -659,6 +659,18 @@ begin
|
||||||
Free;
|
Free;
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$IFDEF DARWIN}
|
||||||
|
with TProcess.Create(nil) do
|
||||||
|
try
|
||||||
|
Executable := 'open';
|
||||||
|
Parameters.Add(aFilename);
|
||||||
|
Execute;
|
||||||
|
finally
|
||||||
|
result := true;
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function exeInSysPath(anExeName: string): boolean;
|
function exeInSysPath(anExeName: string): boolean;
|
||||||
|
@ -911,6 +923,34 @@ begin
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF DARWIN}
|
||||||
|
function internalAppIsRunning(const ExeName: string): integer;
|
||||||
|
var
|
||||||
|
proc: TProcess;
|
||||||
|
lst: TStringList;
|
||||||
|
begin
|
||||||
|
Result := 0;
|
||||||
|
proc := tprocess.Create(nil);
|
||||||
|
proc.Executable := 'pgrep';
|
||||||
|
proc.Parameters.Add(ExeName);
|
||||||
|
proc.Options := [poUsePipes, poWaitonexit];
|
||||||
|
try
|
||||||
|
proc.Execute;
|
||||||
|
lst := TStringList.Create;
|
||||||
|
try
|
||||||
|
lst.LoadFromStream(proc.Output);
|
||||||
|
Result := StrToIntDef(Trim(lst.Text), 0);
|
||||||
|
finally
|
||||||
|
lst.Free;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
proc.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function AppIsRunning(const ExeName: string):Boolean;
|
function AppIsRunning(const ExeName: string):Boolean;
|
||||||
begin
|
begin
|
||||||
Result:= internalAppIsRunning(ExeName) > 0;
|
Result:= internalAppIsRunning(ExeName) > 0;
|
||||||
|
|
Loading…
Reference in New Issue