unit UAppCentreLib; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, AppCentreCom_TLB, StdCtrls, ExtCtrls, superobject; function Authenticate(AAuthURL, AAppSecret: PChar): PChar; stdcall; function GetInstallationDirectory(AAppKey: PChar): PChar; stdcall; function RegisterInstallationDirectory(AAppKey: PChar; ADir: PChar): Integer; stdcall; implementation function Authenticate(AAuthURL, AAppSecret: PChar): PChar; stdcall; var AppCentreCom: ILXTAppCentreCom; jo: ISuperObject; JsonStr, rStr: string; begin AppCentreCom := CoLXTAppCentreCom.Create; JsonStr := AppCentreCom.Authenticate(AAuthURL, AAppSecret); Result := ''; if JsonStr <> '' then begin jo := SO(JsonStr); rStr := jo.S['id']; Result := PChar(rStr); end; end; function GetInstallationDirectory(AAppKey: PChar): PChar; stdcall; var AppCentreCom: ILXTAppCentreCom; begin AppCentreCom := CoLXTAppCentreCom.Create; Result := AppCentreCom.GetInstallationDirectory(AAppKey); end; function RegisterInstallationDirectory(AAppKey: PChar; ADir: PChar): Integer; stdcall; var AppCentreCom: ILXTAppCentreCom; begin AppCentreCom := CoLXTAppCentreCom.Create; Result := AppCentreCom.RegisterInstallationDirectory(AAppKey, ADir); end; end.