I have the code working on Windows and Linux. However, due to Apple's App bundling, I am unable to have one Lazarus App, run Another Lazarus App.
* Now what I would like to do is deploy
MyProject.App
in \Contents\MacOS\ also include the binaries of the other Apps (modules for this project).
I have tried simply copying the binary into the MyProject.App/Contents/MacOS/ folder - can pass the Path to that Binary, and call the binary - without success.
I have tried to copy the module (IM.app) folder to MyProject.App/Contents/MacOS/ folder - without success.
Do I chain to Folder.App, or to Folder.App/Content/MacOS/Folder ?
Current EXEC code:
procedure Exec(Prog:String;SpkLargeButton:TSpkLargeButton);
var
Proc:TProcess;
Begin
SpkLargeButton.Enabled:=False;
Proc:=TProcess.Create(Nil);
{$IFDEF DARWIN}
Proc.CurrentDirectory:=ExtractFilePath(Paramstr(0))+Prog+'.app/Contents/MacOS/';
ShowMessage(Proc.CurrentDirectory);
{$ELSE}
Proc.CurrentDirectory:=ExtractFilePath(Paramstr(0));
{$ENDIF}
Proc.Executable:=Prog;
Proc.Active:=True;
while Proc.Running do begin
Application.ProcessMessages;
Sleep(1);
end;
// ShowMessage('Result code: '+IntToStr(Proc.ExitCode));
Proc.Free;
SpkLargeButton.Enabled:=True;
end;