Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-09

Running external process from within Lazarus design package

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bernd

I need to run an external program from within my lazarus package. Unfortunately it will need significant time to run, so I cannot just wait for it in the main thread and also it will produce some important diagnostic console output that I would like to print into the messages window.

Is there any possibility to use the same mechanism that is used when compiling or when running other external tools (tools menu) from within my lazarus package? It would be enough if someone could point me to some existing lines of code where this has been done already or maybe just name the needed ide units or the T<whatever>Boss or manager class that is responsible for this and where to find it.

Bernd

Reply by email

Bernd
to Bernd

2012/9/28 Bernd :

I need to run an external program from within my lazarus package.

Ok, I think I have found this one myself, this seems to work:

uses
  IDEExternToolIntf;
begin
  ...
  Tool := TIDEExternalToolOptions.Create;
  Tool.Filename := '/bin/sh';
  Tool.CmdLineParams := 'DEBUILD.sh';
  Tool.WorkingDirectory := Settings.GetProjectDir;
  Tool.ShowAllOutput := True;
  RunExternalTool(Tool);
  Tool.Free;

My other question (the other thread) regarding the version info is still open.

Bernd

Reply by email