Combine Files

How can I combine my executable with its dlls so that when i execute the application the dlls are automaticaly copyed from the exe file to another directory.I don't want to create an installer.
[198 byte] By [nemok] at [2007-11-18 13:41:43]
# 1 Re: Combine Files
What DLLs does your app use? If you're using only kernel32.dll and ntdll.dll, you don't need to worry about copying/installing DLLs. Anything else gets complicated pretty quick. There's a reason for installation programs...
vicodin451 at 2007-11-11 2:09:10 >
# 2 Re: Combine Files
Excellent question.

I would like to know the solution too.

Kuphryn
kuphryn at 2007-11-11 2:10:21 >
# 3 Re: Combine Files
Originally posted by kuphryn
Excellent question.

I would like to know the solution too.
Excelent answer, teacher... :D :D :D
ovidiucucu at 2007-11-11 2:11:20 >
# 4 Re: Combine Files
One potential solution that comes to mind (I haven't worked out the details) is to embed every DLL as a resource in the EXE. All functions that are in DLLs should be called via LoadLibrary / GetProcAddress. One may assume that certain DLLs exist on a system (Kernel32.dll, NTDll.DLL), and not need to do this for those. If LoadLibrary fails, extract the DLL resource from the EXE, and try it again.

Of course, doing GPA with DLLs that export classes would certainly be a pain...
vicodin451 at 2007-11-11 2:12:17 >
# 5 Re: Combine Files
Why don't you just buy an installer package ?

Or if you've got VC.NET it already has one embedded in the IDE.

Darwen.
darwen at 2007-11-11 2:13:15 >
# 6 Re: Combine Files
vicodin451,

Yeah, I have seen such applications too. I would really like to see the implementation though.

How do you embed DLL or even EXE into an executable and then extract it? Please post the tutorial.

Kuphryn
kuphryn at 2007-11-11 2:14:23 >
# 7 Re: Combine Files
You can always use a self extracting Zip file. Have a look at zlib.

No I'm not going to post a tutorial - it would be much too big and I really don't have time.

Darwen.
darwen at 2007-11-11 2:15:16 >
# 8 Re: Combine Files
Originally posted by kuphryn
vicodin451,

Yeah, I have seen such applications too. I would really like to see the implementation though.

How do you embed DLL or even EXE into an executable and then extract it? Please post the tutorial.

Kuphryn

I don't have a tutorial, but gstercken has discussed embedding files as resources in an EXE:
http://www.dev-archive.com/forum/showthread.php?s=&threadid=271033&highlight=LoadResource

http://www.dev-archive.com/forum/showthread.php?s=&threadid=236378&highlight=resource+file

I might note that the DependencyWalker tool from www.DependencyWalker.com does this type of thing with its DEPENDS.DLL as well as its help file - DEPENDS.EXE has 3 resources of type "FILE" "inside" of it.
vicodin451 at 2007-11-11 2:16:19 >