Skip to content
Permalink
Browse files

Raise error before LoadLibrary is called, when library file does not …

…exist, so the user gets a more reasonable message
  • Loading branch information...
ansgarbecker committed Jul 26, 2019
1 parent 53b8f54 commit 13fa85e5671a825a162810f3ea84d2bef6f9dd17
Showing with 11 additions and 3 deletions.
  1. +3 −3 out/locale/en/LC_MESSAGES/default.po
  2. +8 −0 source/dbstructures.pas
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: HeidiSQL\n"
"POT-Creation-Date: 2012-11-05 21:40\n"
"PO-Revision-Date: 2019-07-23 21:57+0200\n"
"PO-Revision-Date: 2019-07-26 20:47+0200\n"
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
"MIME-Version: 1.0\n"
@@ -4039,8 +4039,8 @@ msgid "Library %s seems unusable. Please select a different one."
msgstr "Library %s seems unusable. Please select a different one."

#: dbconnection.pas:1392
msgid "Cannot find a usable %s. Please launch %s from the directory where you have installed it."
msgstr "Cannot find a usable %s. Please launch %s from the directory where you have installed it."
msgid "Please launch %s from the directory where you have installed it. Or just reinstall %s."
msgstr "Please launch %s from the directory where you have installed it. Or just reinstall %s."

msgid "Internal error %d: %s"
msgstr "Internal error %d: %s"
@@ -7670,6 +7670,14 @@ constructor TDbLib.Create(DllFile: String);
// Load DLL as is (with or without path)
inherited Create;
FDllFile := DllFile;
if not FileExists(FDllFile) then begin
msg := f_('File does not exist: %s', [FDllFile]) +
sLineBreak + sLineBreak +
f_('Please launch %s from the directory where you have installed it. Or just reinstall %s.', [APPNAME, APPNAME]
);
Raise EdbError.Create(msg);
end;

FHandle := LoadLibrary(PWideChar(FDllFile));
if FHandle = 0 then begin
msg := f_('Library %s could not be loaded. Please select a different one.',

0 comments on commit 13fa85e

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