diff --git a/out/locale/en/LC_MESSAGES/default.po b/out/locale/en/LC_MESSAGES/default.po index 45e26434..3760abb7 100644 --- a/out/locale/en/LC_MESSAGES/default.po +++ b/out/locale/en/LC_MESSAGES/default.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: HeidiSQL\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 \n" "Language-Team: English (http://www.transifex.com/projects/p/heidisql/" "language/en/)\n" @@ -4013,6 +4013,9 @@ msgstr "OLE DB property \"%s\": %s" msgid "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 msgid "Library error in %s: Could not find procedure address for \"%s\"" msgstr "Library error in %s: Could not find procedure address for \"%s\"" diff --git a/source/dbconnection.pas b/source/dbconnection.pas index d0243d4e..5410a31b 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -2117,12 +2117,20 @@ end; procedure TPgConnection.DoBeforeConnect; +var + LibWithPath: String; begin // Init lib before actually connecting. // Each connection has its own library handle if LibPqHandle = 0 then begin Log(lcDebug, f_('Loading library file %s ...', [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 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