I have created some functions which are dll resident. I wanted to know if there is any program which

can let me combine the Exe and Dll so that the user doesnt have to bother whether the DLL is in the same

folder or even if he loses the Dll. The program should be such that the dll is extracted in tmp directory and

deleted after the user quits. So can any one help me finding such a program or is there a way in assembly to

do this???
Posted on 2003-04-24 00:10:33 by telophase
Posted on 2003-04-24 00:16:15 by donkey
telophase,

The area has been discussed in here from time to time but the basics are you can easily store a DLL in an EXE file in DB format then write it to disk when you need to use it and optionally delete it when you have finished.

There is a tool written by Jeremy Collake that will internally load a DLL that is stored in an EXE image so if you look in google for "collakesoftware" you will see what he has to offer.

f0dder also produced a tool that makes a file into a library module that can be accessed and written to disk as well so you have a number of ways to do what you are after.

Regards,

hutch@movsd.com
Posted on 2003-04-24 01:06:21 by hutch--
And once again I will use the opportunity to say doing this is a bad idea. Understand all the implications of doing it before you do it...
Posted on 2003-04-24 02:09:20 by f0dder
telophase,
Why? You are missing the whole point of having a dll, you might as well just put the functions into the exe and get rid of the dll.

so that the user doesnt have to bother whether the DLL is in the same folder
The dll doesn't have to reside in the same folder as the exe. You can put it anywhere. If the location is not already one of the PATHS in the envars, then add a new path.


The program should be such that the dll is extracted in tmp directory and deleted after the user quits
What if the system or the app crashes? What if another process does a TerminateProcess on your exe, or it is shut down from the task manager? In these cases the dll is not going to get cleaned up.

Sure, you *can* extract a dll to a temp folder then use it, but there are few reasons why you should need to do that, and many reasons that you shouldn't.
Posted on 2003-04-24 02:10:25 by sluggy