mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Load libpq.dll with full path, so the LoadLibrary does not accidentally take a different (probably wrong) one from somewhere else than the current directory. See http://www.heidisql.com/forum.php?t=21039
This commit is contained in:
@ -2090,12 +2090,15 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TPgConnection.DoBeforeConnect;
|
procedure TPgConnection.DoBeforeConnect;
|
||||||
|
var
|
||||||
|
LibWithPath: String;
|
||||||
begin
|
begin
|
||||||
// Init lib before actually connecting.
|
// Init lib before actually connecting.
|
||||||
// Each connection has its own library handle
|
// Each connection has its own library handle
|
||||||
if LibPqHandle = 0 then begin
|
if LibPqHandle = 0 then begin
|
||||||
Log(lcDebug, f_('Loading library file %s ...', [LibPqPath]));
|
LibWithPath := ExtractFileDir(Application.ExeName) + '\' + LibPqPath;
|
||||||
LibPqHandle := LoadLibrary(PWideChar(LibPqPath));
|
Log(lcDebug, f_('Loading library file %s ...', [LibWithPath]));
|
||||||
|
LibPqHandle := LoadLibrary(PWideChar(LibWithPath));
|
||||||
if LibPqHandle = 0 then
|
if LibPqHandle = 0 then
|
||||||
raise EDatabaseError.CreateFmt(_('Cannot find a usable %s. Please launch %s from the directory where you have installed it.'), [LibPqPath, ExtractFileName(ParamStr(0))])
|
raise EDatabaseError.CreateFmt(_('Cannot find a usable %s. Please launch %s from the directory where you have installed it.'), [LibPqPath, ExtractFileName(ParamStr(0))])
|
||||||
else begin
|
else begin
|
||||||
|
Reference in New Issue
Block a user