ImageEn, unit ievision

IELibAvailable


Declaration

function IELibAvailable(ExeFolderOnly: Boolean = False; RaiseException: Boolean = False) : Boolean;   overload;
function IELibAvailable(const DLLPath: WideString; RaiseException: Boolean = False): boolean; overload;


Description

Returns true if the DLLs required by ImageEn are available (e.g. ielib64.dll for a 64bit ImageEn application). Also initializes the library.
If ExeFolderOnly is true, only the folder of the application EXE is checked for IELib DLLs.
Alternatively, you can specify a path to the DLL, which can either be a full filename or a folder.
If RaiseException is enabled, the following exception will be raised if the library is not found: "A required library file (ievision.dll or ielib.dll) was not found or is outdated (Version expected: x.x.x.x)"

Note:
You are better to use RegisterPlugIns or PlugInAvailable rather than IELibAvailable
The expected version of IELib is available from: ImageEnVersion.IELibVersionStr


Example

procedure TMainForm.FormShow(Sender: TObject);
begin
  if IELibAvailable() = False then
    MessageDlg(format('The installation is incomplete. Please reinstall %s', [Application_Name]), mtError, [mbOK], 0);
end;

// Which is the same as:
procedure TMainForm.FormShow(Sender: TObject);
begin
  IEGlobalSettings().RegisterPlugIns( [iepiIELib] );
  if not ( iepiIELib in IEGlobalSettings().ActivePlugIns ) then
    MessageDlg(format('The installation is incomplete. Please reinstall %s', [Application_Name]), mtError, [mbOK], 0);
end;


See Also

RegisterPlugIns
ImageEnVersion.IELibVersionStr
DLLLoadingLog