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;