Skip to content
Permalink
Browse files

Fix duplicated application directory prepended on library path

  • Loading branch information...
ansgarbecker committed Jun 19, 2019
1 parent a77eedd commit 59e3ba4b34cd19dc37f1b3cf0e220bf9ac78f313
Showing with 4 additions and 3 deletions.
  1. +4 −3 source/dbconnection.pas
@@ -2250,6 +2250,7 @@ procedure TMySQLConnection.DoBeforeConnect;

// Try newer libmariadb version at first, and fall back to libmysql,
// then fall back to dlls somewhere else on the users harddisk
// Win XP needs libmysql.dll
TryLibraryPaths := TStringList.Create;
TryLibraryPaths.Add(ExtractFilePath(Application.ExeName) + 'libmariadb.dll');
TryLibraryPaths.Add(ExtractFilePath(Application.ExeName) + 'libmysql.dll');
@@ -2259,12 +2260,12 @@ procedure TMySQLConnection.DoBeforeConnect;
for TryLibraryPath in TryLibraryPaths do begin
Log(lcDebug, f_('Loading library file %s ...', [TryLibraryPath]));
try
FLib := TMySQLLib.Create(ExtractFilePath(Application.ExeName) + TryLibraryPath);
FLib := TMySQLLib.Create(TryLibraryPath);
Log(lcDebug, FLib.DllFile + ' v' + DecodeApiString(FLib.mysql_get_client_info) + ' loaded.');
Break;
except
// Win XP needs libmysql.dll
Log(lcDebug, f_('Could not load %s', [TryLibraryPath]));
on E:Exception do
Log(lcDebug, E.Message);
end
end;
if not Assigned(FLib) then begin

0 comments on commit 59e3ba4

Please sign in to comment.
You can’t perform that action at this time.