How to determine the executable locations of Melitus app for Linux and MacOS?

Hi

var dbPath: String;

The following code works for WINDOWS:
GetMiletusPath(NP_APPDATA, dbPath) returns the correctly c:\users\lliew\AppData\Roaming

However, nothing is returned for LINUX and MacOS.

I have a database file (created dynamically if not present), and config files (config.ini) - which I need to know the path of the Melitus app to create and read them.

I cannot find any example code online or in this forum.

Any help would be appreciated.

Thanks!

Hi,

Some synchronous functions such as GetMiletusPath is only supported on Windows. There are async promise-based versions which you can use on all platforms. In you case GetMiletusPathP would look something like this:

type
  TForm1 = class(TMiletusForm)
    WebButton1: TWebButton;
    [async]
    procedure WebButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.WebButton1Click(Sender: TObject);
var
  p: string;
begin
  p := TAwait.ExecP<string>(GetMiletusPathP(NP_APPDATA));
end;

Thanks @Tunde it works now. It would be good to have example in The docs.

the use of TAwait.ExecP also fixes a lot of other issues compared to await( ) format.

We'll look to update the documentation to contain this.