0

As we know, when trying to run a program with some of its dependent DLL missing, the system would complain about "missing dll" error. The approach I'm using to avoid this is to pack all those dependent DLL into the installer, so that the software could run in other devices. Yet with the growing number of dependent DLL, manually search and copy DLL turns out to be such a chore, especially considering that these direct dependent DLL are likely have their own dependencies.

I have known dumpbin, Dependency Walker and Dependencies to track DLL dependencies. But they only list the dependent DLL. I was wondering is there any command/script/tool that could:

  1. recursivly search the dependent DLL of an executable
  2. copy those dependencies to a specified directory
  3. preferably, support exclude DLL from specified directories, like C:\WINDOWS\system32\

To be honest, I don't know if this kind of thing ever exists. If it doesn't, how do you guys deal with this DLL issue?

tanjor
  • 71
  • 2
  • 4
  • 1
    What problem are you _actually_ trying to resolve? This looks like an [XY Problem](http://xyproblem.info/) to me – Jabberwocky Mar 17 '20 at 08:06
  • 1
    That tool does not exist. It cannot exist, since not all dependencies can be discovered statically. How do *I* deal with this? I set up CI and make sure to test the installer on a clean system. – IInspectable Mar 17 '20 at 10:02
  • @Jabberwocky Well, what I want to do is release my software in the form of an installer. And clearly, I don't want users to face the "missing DLL" error when they try to run the software after installation. To reach this goal, I use Dependencies to find out DLL dependencies, manually copy these DLL out, then add them into my installer project. It did resolve my problem, but such a process is tedious and error-prone. So, my question can be summarized as, is there any better way to deal with the DLL dependencies when trying to release an EXE? – tanjor Mar 18 '20 at 02:55
  • As it is _your_ software you want to have an installer for, _you_ already know which dlls are used by your software. Just distribute these dlls. For various system dlls you probably need to distribute them in form of the [Microsoft redistributables](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads). – Jabberwocky Mar 18 '20 at 07:33
  • Just checking whether you have seen [this answer](https://stackoverflow.com/a/51940598/129130). [Procmon](https://stackoverflow.com/questions/47746076/registering-a-cpp-dll-into-com-after-installation-using-wix-msi-installer/47792474#47792474) and [NDepend](https://stackoverflow.com/questions/7378959/how-to-check-for-dll-dependency/44501111#44501111) should be worth a look for advanced dependency debugging. – Stein Åsmul Oct 13 '20 at 12:53

1 Answers1

0

I have been using InstallAware Express CodeGear Edition under this link http://cc.embarcadero.com/Item/24997

It was no longer continued. But there is a menu there that it finds and locates the depended dll or bpl files, and you create a quick and dirty install project, all copied into one folder. Than you can use them for your application. This is no longer works for me, and I am also looking for another tool for this. If you find something please let me know.