How to handle dependencies (DLL’s) in Delphi/Lazarus?

Asked

Viewed 1,731 times

4

  • How do I find out which ones DLL’s I must distribute along with my application for it to work on any machine?

  • I know Installshield - which does business in an automated way - but I would like to know if there is any free way to do it, however manual?

  • And another question: it is enough to include the DLL’s in the same folder as my application’s executable or there is DLL’s which need to be included in other folders (such as System32, for example)?

  • What an automated business Installshield does?

  • @Embarrasses, it analyzes your application, maps the DLL’s that it accesses (for this he asks you to run the application and "browse" for it) and then generates the installer already with the DLL’s included. In case, if it were to do without it, I would not know which DLL’s include, where to find and distribute them in the same folder as the .exe is enough.

2 answers

3

How do I find out which DLL’s I should distribute together with my app so it works on any machine?

I know the Installshield - it does business in an automated way, but I would like to know if there is any free way to do this, even if manual?

The Dependency Walker seems to be a good utility for this.

Some characteristics:

  • Free
  • Available for Windows 95, 98, Me, NT, 2000, XP, 2003, Vista, 7 and 8
  • It can process any Windows module 32 bits or 64 bits, including those developed for the Windows CE

inserir a descrição da imagem aqui

It is sufficient to include the DLL’s in the same folder as the executable from my application or there are DLL’s that need to be included in other folders (such as System32, for example)?

This will depend a lot on the purpose of your application, but the ideal is to put the DLLS in the same executable folder, use other folders like System32 will probably create a deadlock with user permissions(WOW). A good place to store the application data is in the folder Appdata.

Like mentioned by Embarbosa, avoid using the folder System32 can also save you from problems like DLL Hell.

3


The normal is that you know which dlls your software depends on. It doesn’t make sense for your software to depend on a dll and you as a programmer not to know this.

Some options however are:

  1. In Delphi ,during the debug of your program, you can use the View menu -> Debug Windows -> Modules. It shows all dlls loaded.
  2. As mentioned in response by DBX8 you can use the Dependencywalker.
  3. At the command prompt (cmd) use the command tasklist /m. It will make a list of all dlls used by each specific program being run.

A related question in the OS is this: https://stackoverflow.com/questions/475148/how-do-i-find-out-which-dlls-an-executable-will-load

  • The problem is as follows: I opened a project here and this screen indicated 30 different DLL’s. However, Installshield only specified one DLL to include. That is: this list of DLL’s is not filtered, it includes DLL’s that are from Windows itself.

  • @user3153542 You said you would serve something that was manual. Any of the options are manual. I’m adding other tools to the list, but outside of manual processes, I don’t know exactly what you could do.

  • Okay, I think I got used to the Installshield, I thought there could be something similar but free. The way is to manage with what you have. :)

  • @user3153542 may even exist, but I don’t know. The fact is that "in all these years in this vital industry" I never needed to search for a dll in my software that I have not added purposefully. For "third party" software I already used Peexplorer, Filemon, Softice, etc... but then the work was always manual same. :)

  • Installshield returned only one DLL because the others are standard Windows or you configured it to get from your original packages, which are often available in standard links on the manufacturer’s website (very common with MSVCRT, distributed by Microsoft). It may be until you change the settings of Installshield, you get different results (like more or less DLL’s).

  • @Viníciusgobboa.deOliveira I think your comment should be directed to the originator of the question. (:

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.