mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Suppress errors in LoadLibrary(libmariadb.dll) on Windows XP. Instead, try loading the XP-compatible libmysql.dll v5.6.6. Closes #79.
This commit is contained in:
@ -77,7 +77,6 @@ Name: "activate_statistics"; Description: "Automatically report client and serve
|
|||||||
[InstallDelete]
|
[InstallDelete]
|
||||||
Type: files; Name: "{app}\libmysql40.dll"
|
Type: files; Name: "{app}\libmysql40.dll"
|
||||||
Type: files; Name: "{app}\libmysql41.dll"
|
Type: files; Name: "{app}\libmysql41.dll"
|
||||||
Type: files; Name: "{app}\libmysql.dll"
|
|
||||||
Type: files; Name: "{app}\{#ProgExeName}.manifest"
|
Type: files; Name: "{app}\{#ProgExeName}.manifest"
|
||||||
Type: files; Name: "{app}\{#ProgNameLower}.url"
|
Type: files; Name: "{app}\{#ProgNameLower}.url"
|
||||||
Type: files; Name: "{app}\{#ProgNameLower}_forum.url"
|
Type: files; Name: "{app}\{#ProgNameLower}_forum.url"
|
||||||
@ -91,6 +90,8 @@ Source: "license.txt"; DestDir: "{app}"; Flags: ignoreversion
|
|||||||
Source: "gpl.txt"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "gpl.txt"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "libmariadb64.dll"; DestDir: "{app}"; DestName: "libmariadb.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
|
Source: "libmariadb64.dll"; DestDir: "{app}"; DestName: "libmariadb.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
|
||||||
Source: "libmariadb32.dll"; DestDir: "{app}"; DestName: "libmariadb.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
|
Source: "libmariadb32.dll"; DestDir: "{app}"; DestName: "libmariadb.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
|
||||||
|
Source: "libmysql64.dll"; DestDir: "{app}"; DestName: "libmysql.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
|
||||||
|
Source: "libmysql32.dll"; DestDir: "{app}"; DestName: "libmysql.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
|
||||||
Source: "libpq64.dll"; DestDir: "{app}"; DestName: "libpq.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
|
Source: "libpq64.dll"; DestDir: "{app}"; DestName: "libpq.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
|
||||||
Source: "libpq32.dll"; DestDir: "{app}"; DestName: "libpq.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
|
Source: "libpq32.dll"; DestDir: "{app}"; DestName: "libpq.dll"; Check: not Is64BitInstallMode; Flags: ignoreversion
|
||||||
Source: "libintl-864.dll"; DestDir: "{app}"; DestName: "libintl-8.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
|
Source: "libintl-864.dll"; DestDir: "{app}"; DestName: "libintl-8.dll"; Check: Is64BitInstallMode; Flags: ignoreversion
|
||||||
|
BIN
out/libmysql32.dll
Normal file
BIN
out/libmysql32.dll
Normal file
Binary file not shown.
BIN
out/libmysql64.dll
Normal file
BIN
out/libmysql64.dll
Normal file
Binary file not shown.
@ -2083,14 +2083,20 @@ end;
|
|||||||
procedure TMySQLConnection.DoBeforeConnect;
|
procedure TMySQLConnection.DoBeforeConnect;
|
||||||
var
|
var
|
||||||
msg: String;
|
msg: String;
|
||||||
|
OldErrorMode: Cardinal;
|
||||||
begin
|
begin
|
||||||
// Init libmysql before actually connecting.
|
// Init libmysql before actually connecting.
|
||||||
// Try newer libmariadb version at first, and fall back to libmysql
|
// Try newer libmariadb version at first, and fall back to libmysql
|
||||||
if LibMysqlHandle = 0 then begin
|
if LibMysqlHandle = 0 then begin
|
||||||
LibMysqlPath := 'libmariadb.dll';
|
LibMysqlPath := 'libmariadb.dll';
|
||||||
Log(lcDebug, f_('Loading library file %s ...', [LibMysqlPath]));
|
Log(lcDebug, f_('Loading library file %s ...', [LibMysqlPath]));
|
||||||
|
// Temporarily suppress error popups while loading new library on Windows XP, see #79
|
||||||
|
OldErrorMode := SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||||
|
SetErrorMode(OldErrorMode or SEM_FAILCRITICALERRORS);
|
||||||
LibMysqlHandle := LoadLibrary(PWideChar(LibMysqlPath));
|
LibMysqlHandle := LoadLibrary(PWideChar(LibMysqlPath));
|
||||||
|
SetErrorMode(OldErrorMode);
|
||||||
if LibMysqlHandle = 0 then begin
|
if LibMysqlHandle = 0 then begin
|
||||||
|
// Win XP goes here, or users without the above library. Load an XP-compatible one here.
|
||||||
Log(lcDebug, f_('Could not load %s', [LibMysqlPath]));
|
Log(lcDebug, f_('Could not load %s', [LibMysqlPath]));
|
||||||
LibMysqlPath := 'libmysql.dll';
|
LibMysqlPath := 'libmysql.dll';
|
||||||
Log(lcDebug, f_('Loading library file %s ...', [LibMysqlPath]));
|
Log(lcDebug, f_('Loading library file %s ...', [LibMysqlPath]));
|
||||||
|
Reference in New Issue
Block a user