mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Fix duplicated application directory prepended on library path
This commit is contained in:
@ -2250,6 +2250,7 @@ begin
|
|||||||
|
|
||||||
// Try newer libmariadb version at first, and fall back to libmysql,
|
// Try newer libmariadb version at first, and fall back to libmysql,
|
||||||
// then fall back to dlls somewhere else on the users harddisk
|
// then fall back to dlls somewhere else on the users harddisk
|
||||||
|
// Win XP needs libmysql.dll
|
||||||
TryLibraryPaths := TStringList.Create;
|
TryLibraryPaths := TStringList.Create;
|
||||||
TryLibraryPaths.Add(ExtractFilePath(Application.ExeName) + 'libmariadb.dll');
|
TryLibraryPaths.Add(ExtractFilePath(Application.ExeName) + 'libmariadb.dll');
|
||||||
TryLibraryPaths.Add(ExtractFilePath(Application.ExeName) + 'libmysql.dll');
|
TryLibraryPaths.Add(ExtractFilePath(Application.ExeName) + 'libmysql.dll');
|
||||||
@ -2259,12 +2260,12 @@ begin
|
|||||||
for TryLibraryPath in TryLibraryPaths do begin
|
for TryLibraryPath in TryLibraryPaths do begin
|
||||||
Log(lcDebug, f_('Loading library file %s ...', [TryLibraryPath]));
|
Log(lcDebug, f_('Loading library file %s ...', [TryLibraryPath]));
|
||||||
try
|
try
|
||||||
FLib := TMySQLLib.Create(ExtractFilePath(Application.ExeName) + TryLibraryPath);
|
FLib := TMySQLLib.Create(TryLibraryPath);
|
||||||
Log(lcDebug, FLib.DllFile + ' v' + DecodeApiString(FLib.mysql_get_client_info) + ' loaded.');
|
Log(lcDebug, FLib.DllFile + ' v' + DecodeApiString(FLib.mysql_get_client_info) + ' loaded.');
|
||||||
Break;
|
Break;
|
||||||
except
|
except
|
||||||
// Win XP needs libmysql.dll
|
on E:Exception do
|
||||||
Log(lcDebug, f_('Could not load %s', [TryLibraryPath]));
|
Log(lcDebug, E.Message);
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
if not Assigned(FLib) then begin
|
if not Assigned(FLib) then begin
|
||||||
|
Reference in New Issue
Block a user