Include dll into .exe
Include dll into .exe
Hey all,
My program uses zlibwapi.dll. Is there a way to include it with the .exe itself so it doesn't need to be included in the program directory?
Thanks
My program uses zlibwapi.dll. Is there a way to include it with the .exe itself so it doesn't need to be included in the program directory?
Thanks
Re: Include dll into .exe
Nope, sorry, no way for .dll (dynamic link lib) loaded/linked at run time.
Only static lib's are linkable at compile time (included in .exe).
Only static lib's are linkable at compile time (included in .exe).
Re: Include dll into .exe
Yes for windows at least, it is possible to embed the DLL into the exe and call it directly from the memory. Check this out: http://www.joachim-bauch.de/tutorials/l ... om-memory/Provoni wrote:Hey all,
My program uses zlibwapi.dll. Is there a way to include it with the .exe itself so it doesn't need to be included in the program directory?
Thanks
Re: Include dll into .exe
never tried it but apparently it can be done, here's a purebasic solution https://www.purebasic.fr/english/viewto ... dll+binary
Re: Include dll into .exe
Definitely it can be done. I did it using Autoit in several project I made. ;-)srvaldez wrote:never tried it but apparently it can be done, here's a purebasic solution https://www.purebasic.fr/english/viewto ... dll+binary
Re: Include dll into .exe
I have little doubts about that, see How to convert a dynamic dll to static lib? at SOF.
What is certainly possible (and easy to do) is to include the DLL as an RCDATA resource, and to write it to the executable's folder during the first run. In comparison, the PureBasic version posted above may work for some dlls but is ridiculously complicated.
Btw the easiest solution would be to compile the source as a static lib.
What is certainly possible (and easy to do) is to include the DLL as an RCDATA resource, and to write it to the executable's folder during the first run. In comparison, the PureBasic version posted above may work for some dlls but is ridiculously complicated.
Btw the easiest solution would be to compile the source as a static lib.
Re: Include dll into .exe
@jj2007
in the link you provided it seems that they are talking about an import lib and not a static lib
in the link you provided it seems that they are talking about an import lib and not a static lib
Re: Include dll into .exe
Thanks for your answers everyone.
Can you give a short run down?UEZ wrote: Definitely it can be done. I did it using Autoit in several project I made. ;-)
Re: Include dll into .exe
What do you need exactly?Provoni wrote:Thanks for your answers everyone.
Can you give a short run down?UEZ wrote: Definitely it can be done. I did it using Autoit in several project I made. ;-)
Re: Include dll into .exe
Hey UEZ,
Include a dll into .exe, but if there is not a elegant and simple solution then I will skip it.
Thanks
Include a dll into .exe, but if there is not a elegant and simple solution then I will skip it.
Thanks
Re: Include dll into .exe
Afaik, there is no solution for Freebasic yet unless someone is willing to port it to Freebasic, too. For other languages, e.g. AutoIt, yes. I can provide you a sample code but this will be out of scope for this forum providing non Freebasic code.Provoni wrote:Hey UEZ,
Include a dll into .exe, but if there is not a elegant and simple solution then I will skip it.
Thanks
Re: Include dll into .exe
pefrmdllembed could do the job. However not used/tested.Include a dll into .exe, but if there is not a elegant and simple solution then I will skip it.
http://pefrm-units.osdn.jp/pefrmdllembed.html
If you get some difficulty to find an executable I took it from https://www.gtagarage.com/mods/show.php?id=28541 (click on donwload mod)
Don't forget to run your AV on it before executing....
Re: Include dll into .exe
They are talking about several things, and in a fairly confused way even for SOF standards. Of course, an import lib is useless for OP's problem. Converting a DLL into a real static lib, otoh, is a can of worms. The same applies for the attempt to run the code of a DLL from memory: not foreseen by the OS, so you need some dirty hacks to do that.srvaldez wrote:@jj2007
in the link you provided it seems that they are talking about an import lib and not a static lib
The cleanest solution is to include the DLL in the installation package. But then OP might run into licensing problems, I suppose. Is hiding it inside the exe the solution?
Re: Include dll into .exe
Not a licensing problem. Just want the .exe to be stand alone for worst case scenario.jj2007 wrote: The cleanest solution is to include the DLL in the installation package. But then OP might run into licensing problems, I suppose. Is hiding it inside the exe the solution?
Re: Include dll into .exe
Which is?Provoni wrote:worst case scenario.