mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 20:39:14 +02:00
MacOS: Improve external tool execution with an .app application. Issue #36314
git-svn-id: branches/fixes_2_0@62851 -
This commit is contained in:
parent
4ec00f8765
commit
851dc814ae
@ -983,23 +983,33 @@ begin
|
|||||||
debugln(['Error: (lazarus) [TExternalTools.RunToolAndDetach] ',ToolOptions.Title,' failed: missing executable: "',s,'"']);
|
debugln(['Error: (lazarus) [TExternalTools.RunToolAndDetach] ',ToolOptions.Title,' failed: missing executable: "',s,'"']);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if DirectoryExistsUTF8(s) then begin
|
if DirectoryExistsUTF8(s) {$IFDEF DARWIN}and (ExtractFileExt(s)<>'.app'){$ENDIF} then begin
|
||||||
debugln(['Error: (lazarus) [TExternalTools.RunToolAndDetach] ',ToolOptions.Title,' failed: executable is a directory: "',s,'"']);
|
debugln(['Error: (lazarus) [TExternalTools.RunToolAndDetach] ',ToolOptions.Title,' failed: executable is a directory: "',s,'"']);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if not FileIsExecutable(s) then begin
|
if {$IFDEF DARWIN}(ExtractFileExt(s)<>'.app') and{$ENDIF} not FileIsExecutable(s) then begin
|
||||||
debugln(['Error: (lazarus) [TExternalTools.RunToolAndDetach] ',ToolOptions.Title,' failed: executable lacks permission to run: "',s,'"']);
|
debugln(['Error: (lazarus) [TExternalTools.RunToolAndDetach] ',ToolOptions.Title,' failed: executable lacks permission to run: "',s,'"']);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Proc.Executable:=s;
|
|
||||||
|
{$IFDEF DARWIN}
|
||||||
|
if DirectoryExistsUTF8(s) then
|
||||||
|
begin
|
||||||
|
Proc.Executable:='/usr/bin/open';
|
||||||
|
s:=s+LineEnding+ToolOptions.CmdLineParams;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
{$ENDIF}
|
||||||
|
begin
|
||||||
|
Proc.Executable:=s;
|
||||||
|
s:=ToolOptions.CmdLineParams;
|
||||||
|
end;
|
||||||
|
|
||||||
// params
|
// params
|
||||||
s:=ToolOptions.CmdLineParams;
|
if ToolOptions.ResolveMacros and not GlobalMacroList.SubstituteStr(s) then begin
|
||||||
if ToolOptions.ResolveMacros then begin
|
debugln(['Error: (lazarus) [TExternalTools.RunToolAndDetach] ',ToolOptions.Title,
|
||||||
if not GlobalMacroList.SubstituteStr(s) then begin
|
' failed: macros in cmd line params "',ToolOptions.CmdLineParams,'"']);
|
||||||
debugln(['Error: (lazarus) [TExternalTools.RunToolAndDetach] ',ToolOptions.Title,' failed: macros in cmd line params "',ToolOptions.CmdLineParams,'"']);
|
exit;
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
sl:=TStringList.Create;
|
sl:=TStringList.Create;
|
||||||
try
|
try
|
||||||
|
Loading…
Reference in New Issue
Block a user