Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I was wondering if there was a way to embed user referenced .dlls into your executable, rather than just having it copied to your local bin folder.

 

It'd be nice to have a single .exe, rather than an .exe + .dlls. :P

Gamer extraordinaire. Programmer wannabe.
Posted
I'm not sure if I follow you. Your saying you have a DLL (a bunch of classes compiled together) that someone else made and want to put in your executable? Don't think that could be done - least not that I can figure, the DLL's would have to be decompiled, added as individual classes to your project and then recompiled with the project to make a single EXE. Now if the DLL was yours then just take the root classes and add them to your project, but I don't think that's what your saying.
Posted
You can add resources to your project, such as text documents and images. I don't see why a .dll would be any different.
Gamer extraordinaire. Programmer wannabe.
Posted
Because a dll has to be loaded in to memory, entry points found and all sorts of other issues like that. I see this question a lot and always find myself wondering what benefit a 1mb exe has over a 100k exe and a few dlls?

 

With small apps, people like a single executable. Makes it easier to share with friends.. and just more convenient.

Gamer extraordinaire. Programmer wannabe.
  • *Experts*
Posted

You could create a simple setup program or use Winzip to create a self-extracting EXE. Otherwise, no, there's no way to get a DLL embedded into your EXE without some work.

 

You could, theoretically, embed the DLL. At runtime you could get the DLL as a resource and write it to disk. I'm not sure if that would work 100% or if you'd need to also load the DLL yourself. if you're using C++ you're a bit luckier as you can use LoadLibrary to load a standard DLL yourself, though I don't think a .NET managed DLL would work like that.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
Surely anyone who wanted a single exe with no dependancies would have chosen the appropriate language and compiler, i.e. MSVC++, to start off with?

 

Programming in unmanaged C++ just so you could have everything in a single .exe would be nutty.

Gamer extraordinaire. Programmer wannabe.
  • *Experts*
Posted
Since that's the only way to do it effectively, it's not really nutty. More like "required". :-\ What does this program do, anyway? If it's so small, creating it in C++ should be no problem (assuming you're familiar with C++).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...