Modified Installer - Download+Install Libmysql.dll

Use this forum if you want to discuss a problem or ask a question related to a hMailServer beta release.
Post Reply
User avatar
Dravion
Senior user
Senior user
Posts: 2071
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Modified Installer - Download+Install Libmysql.dll

Post by Dravion » 2017-08-14 12:40

Hi,
Some users reported problems installing the correct libmyql.dll version durning hMailServer/MySQL Setup process.
To mitigate this Problem i have written a little DLL (libhmsutils.dll, native - not .NET) which will:

[*]Download the MySQL Connector ZIP-Archive from Oracles MySQL-Website to local Windows Temp Folder
[*]Unzip the downloaded file to a GUID-Uniquefolder (to avoid access and search problems)
[*]Search and locate libmysql.dll inside the extracted folder
[*]Copy libmysql to c:\Program Files (x86)\Bin\hMailServer\Bin\libmysql.dll

The following params can modified as needed in install_dlg.cpp Line: 7
std::wstring locate_libmysql = L"Unknown"; // if libmysql.dll could not be found
std::wstring download_server = L"dev.mysql.com";
std::string webspace_url = "/get/Downloads/Connector-C/";
std::string ZipArchiveName = "mysql-connector-c-6.1.11-win32.zip";


Here you can see how it looks like:
libmysql_dll_select.jpg
The Download and Install-Wizzard
libmysql_dll_setup.jpg
Installer for testing this feature:
https://github.com/Dravion/hmailserver/ ... g/5.6.7-B1

Sourcecode Repo (VS2017)
https://github.com/Dravion/libhmsutils.dll

Notes: The DLL and DLLCall.exe are completely written in C/C++ Win32, without MFC/ATL or Ressource
Editor Dependencies, so this will work within the normal Buildprocess of hMailServer. You only need to
open the libhmsutils.sln solution and click build, it simply will run and build.

User avatar
jimimaseye
Moderator
Moderator
Posts: 10053
Joined: 2011-09-08 17:48

Re: Modified Installer - Download+Install Libmysql.dll

Post by jimimaseye » 2017-08-14 14:26

Copy libmysql to c:\Program Files (x86)\Bin\hMailServer\Bin\libmysql.dll
What if the user doesnt use this path and installs hmailsverer in to, say, d:\hmailserver?
5.7 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

User avatar
Dravion
Senior user
Senior user
Posts: 2071
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Modified Installer - Download+Install Libmysql.dll

Post by Dravion » 2017-08-14 15:28

I use a WQL Query like this:
Select PathName from win32_service Where name ='hMailServer'. This will return the complete Servicepath with all its params. From this String i simply extract the real Installationpath of hMailServers bin folder.

deedubb83
New user
New user
Posts: 1
Joined: 2018-02-15 10:33

Re: Modified Installer - Download+Install Libmysql.dll

Post by deedubb83 » 2018-02-15 10:35

I believe the actual problem isn't resolved by your update. The problem I encountered is that I also needed to install the Visual C++ Redistributable for the libmysql.dll.

I downloaded and installed this: https://www.microsoft.com/en-us/downloa ... x?id=52685 then everything worked.

User avatar
Dravion
Senior user
Senior user
Posts: 2071
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Modified Installer - Download+Install Libmysql.dll

Post by Dravion » 2018-02-15 22:54

Redist DLLs must be installed with or without this Libmysql.dll Installer. But it should installed by hMailServer Mainsetup bc it depends on it.

User avatar
mattg
Moderator
Moderator
Posts: 22435
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Modified Installer - Download+Install Libmysql.dll

Post by mattg » 2018-02-15 23:59

Yep, the only time I've ever had to manually install that was on a 'core server' or a 'hyperV Core' server
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

Post Reply