mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Try to load libpq.dll with explicit file path if the path-less did not succeed. See http://www.heidisql.com/forum.php?t=22514
This commit is contained in:
@ -7,7 +7,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HeidiSQL\n"
|
"Project-Id-Version: HeidiSQL\n"
|
||||||
"POT-Creation-Date: 2012-11-05 21:40\n"
|
"POT-Creation-Date: 2012-11-05 21:40\n"
|
||||||
"PO-Revision-Date: 2016-09-04 13:00+0200\n"
|
"PO-Revision-Date: 2016-11-20 22:19+0100\n"
|
||||||
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
|
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
|
||||||
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/"
|
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/"
|
||||||
"language/en/)\n"
|
"language/en/)\n"
|
||||||
@ -4013,6 +4013,9 @@ msgstr "OLE DB property \"%s\": %s"
|
|||||||
msgid "Loading library file %s ..."
|
msgid "Loading library file %s ..."
|
||||||
msgstr "Loading library file %s ..."
|
msgstr "Loading library file %s ..."
|
||||||
|
|
||||||
|
msgid "Trying to load library with full path: %s"
|
||||||
|
msgstr "Trying to load library with full path: %s"
|
||||||
|
|
||||||
#. DLL loading fails on one procedure
|
#. DLL loading fails on one procedure
|
||||||
msgid "Library error in %s: Could not find procedure address for \"%s\""
|
msgid "Library error in %s: Could not find procedure address for \"%s\""
|
||||||
msgstr "Library error in %s: Could not find procedure address for \"%s\""
|
msgstr "Library error in %s: Could not find procedure address for \"%s\""
|
||||||
|
@ -2117,12 +2117,20 @@ 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]));
|
Log(lcDebug, f_('Loading library file %s ...', [LibPqPath]));
|
||||||
LibPqHandle := LoadLibrary(PWideChar(LibPqPath));
|
LibPqHandle := LoadLibrary(PWideChar(LibPqPath));
|
||||||
|
if LibPqHandle = 0 then begin
|
||||||
|
// Try with explicit file path if the path-less did not succeed. See http://www.heidisql.com/forum.php?t=22514
|
||||||
|
LibWithPath := ExtractFileDir(Application.ExeName) + '\' + LibPqPath;
|
||||||
|
Log(lcInfo, f_('Trying to load library with full path: %s', [LibWithPath]));
|
||||||
|
LibPqHandle := LoadLibrary(PWideChar(LibWithPath));
|
||||||
|
end;
|
||||||
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