Teun
Teun

Reputation: 579

Add .dll files to application

In my application (build with Delphi XE8) I use the IdHTTP component. When I tried to run the application, the following exception was thrown: 'Could not load SSL library'. I solved this issue by downloading the OpenSSL library from this site http://thundaxsoftware.blogspot.nl/2014/09/cannot-load-ssl-library-using-delphi-xe7.html If I'm correct: the files 'libeay32.dll' and 'ssleay32.dll' are needed.

But it only works for me. A friend of mine, who also uses this application, got the same error ("Could not load SSL library"). I want others to be able to download my application without them having to download the OpenSSL library seperately. Is it possible to include these two files into my application? For example by adding a folder to the directory location of the application? If so, how can I make the application find these files when it needs them?

I hope you can help me! (My apologies for the bad English)

Upvotes: 3

Views: 5838

Answers (2)

Ken White
Ken White

Reputation: 125620

You should bundle the DLLs (and any other necessary files) with your application in an installer. The installer can then install the DLLs in the same folder as your application executable, and your app will be able to find them when it's run. It also makes it much easier for your users to get the files into the proper locations by simply running Setup.exe (or YourAppSetup.exe).

There are several products that will create the installer for you, including the free (written in Delphi) Inno Setup.

Upvotes: 4

David Heffernan
David Heffernan

Reputation: 612794

The cleanest way to handle this is to deploy the SSL DLLs to the same directory as your executable file.

Assuming that you do not specify a location for the libraries, Indy will default to using the system DLL search order. And the executable file's directory is the top of that search order. So your DLL files will be found.

By supplying these libraries your app is isolated from other applications. That avoids so-called DLL hell where multiple applications share libraries but all have different version requirements.

Upvotes: 0

Related Questions