Solved

Make EXE not use DLL

Posted on 2004-09-10
33
1,171 Views
Last Modified: 2010-05-18
I am writing a program using glut and I want to send it to a friend. If i just send the EXE, he gets an error message saying that "glut32.dll is not installed" but I dont want to have to send 2 files (the EXE and glut32.dll). How do I build the project so that glut32.dll is not required? Is there a way to do this?
0
Comment
Question by:wertyk
  • 11
  • 7
  • 5
  • +6
33 Comments
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 12024425
Create an Installer with dll added into it and send it to him. He will INSTALL your program which will register the required Dll.

Thx
0
 
LVL 4

Author Comment

by:wertyk
ID: 12024438
i dont really want to make an installer, i just want a standalone exe file that he can run
0
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 12024462
If you just want to send the .EXE file and not the dll file then there is no way he/she can run it without that dll which is used in your program. But I have one more solution: Ask him to download glut32.dll from the net and register it before running your EXE, by this way you have to send him just your EXE and he/she can also run your program.

:-))

CHEErs!
0
 
LVL 4

Author Comment

by:wertyk
ID: 12024618
well i can just send him glut32.dll

but there is no way to like "include" in a way glut32.dll inside of the exe?
0
 
LVL 4

Author Comment

by:wertyk
ID: 12024621
like kinda package them together or something like that?
0
 
LVL 5

Expert Comment

by:tzxie2000
ID: 12025928
you may try to package it into one winrar selfextract package and set the default running program to your exe file
0
 
LVL 3

Expert Comment

by:aravindtj
ID: 12027880
make the project/ application as static.
0
 

Expert Comment

by:Ed_Nelson
ID: 12063002
I think you want something like this...

http://www.molebox.com/

-Ed
0
 
LVL 4

Author Comment

by:wertyk
ID: 12064214
aravindtj-
how do i do that?
0
 
LVL 4

Author Comment

by:wertyk
ID: 12064223
Ed-
yeah thats exactly what i want. now can you make it free?
0
 

Expert Comment

by:Ed_Nelson
ID: 12069835
If you have visual studio .net This is free
http://www.developerfusion.com/show/4504/

This one you can use but to compress files inside .exe you need to register.
http://www.pgware.com/downloads/?file=alloy.exe&type=trial
So this is the same as creating an installer pkg sizewise anyways.

Another not free but lower cost
http://www.softpedia.com/public/cat/5/2/5-2-19.shtml

Another not free but lower cost
http://www.moonlight-software.com/vbpower.htm

Another not free but lower cost
http://www.worldssp.net/software/VB-PowerWrap.htm

Looks like $49.95 minimun for VB    : /
Free for .net
:)
-Ed

0
 
LVL 4

Author Comment

by:wertyk
ID: 12072966
i cant seem to get ilmerge to work. i put ilmerge in the same directoy as my .exe file, and ran

ilmerge /out:project1merged.exe project1.exe c:\windows\system32\glut32.dll

and it gives me

ILMerge.Merge: There are no assemblies to merge in. Must have been an error in reading them in?
0
 

Expert Comment

by:Ed_Nelson
ID: 12073101
Just noticed this does not work with VB.NET, only C#  sry

ilmerge homepage:
http://research.microsoft.com/%7Embarnett/ilmerge.aspx

-Ed

0
 
LVL 4

Author Comment

by:wertyk
ID: 12082998
i'm actually using vc++, but i guess thats not suporrted by ilmerge either.

any other ideas?
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12095700
OK this is very interesting.  I have actually used a program called DLL to LIB that actually converts the DLL code to a static library, that you then link with instead of the normal LIB file.  This program costs, but I downloaded a trial version of it, ran it on a DLL that I created myself and found that I could run the my EXE without the DLL.  When linking with the normal LIB, the DLL was needed.

Download it from http://www.tucows.com/preview/218911.html.  Run it on your DLL, then replace the LIB file you are using currently with the one it generates, #include the header file it generates also, and you should be good to go.

HTH
0
 
LVL 7

Expert Comment

by:Xxavier
ID: 12095907
tell him to put glut32.dll into google and then down load it into the same folder as the .exe from one of the gazillion hits he will get. ( googling a missing .dll is part of "getting an .exe to work 101" )
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 22

Expert Comment

by:cookre
ID: 12096163
DLL to LIB - Claims to be shareware:
http://www.ezgoal.com/channels/developer/f.asp?f=235956
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12096247
cookre:

Hmm.  Interesting.  Well, I figured that shareware has some sort of fee involved somewhere along the line, as opposed to freeware.
0
 
LVL 22

Expert Comment

by:cookre
ID: 12096475
The common understanding is that if you like the package and decide to use it regularly, you pay a nominal fee.  Although there is no legal requirement to pay, it is the proper thing to do.

The only gray area is that of single use.  Some contend that one need pay only if the package is to be used regularly.  Others hold that a single successful use warrants payment.

In the end, it's largely a matter of conscience.
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12096485
Indeed, if the questioner decides to use this software then that is up to him.  I expected there to be some limit on it, say in the size of the DLL it can convert, but after converting Kernel32.DLL I don't think that is the case.  

There is probably some time limit on it hence.  It would be highly unusual for the software to be fully working with the vendors only relying on a person's honesty and morals to get payment ;)
0
 
LVL 4

Author Comment

by:wertyk
ID: 12097954
DLL to Lib made glut32.dll into glut32.lib and glut32_supp.h

what do I do with those to make it work?
0
 
LVL 22

Expert Comment

by:cookre
ID: 12098100
They need to be explicitly added to the project.

Which compiler are you using, and if applicable, what is the project type?
0
 
LVL 22

Expert Comment

by:cookre
ID: 12098138
For what it's worth, I just looked at the GLUT download page:
http://www.opengl.org/resources/libraries/glut/glut_downloads.html
The downloadable glutdlls36.zip already has LIBs in it.
0
 
LVL 4

Author Comment

by:wertyk
ID: 12099938
visual c++ .net 2003
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12100524
There should be something in there that allows you to chose what to link the project with.  You need to add the lib file that was created by DLL to LIB here.  Also #inlcude the header file generated in the main source file too.
0
 
LVL 22

Expert Comment

by:cookre
ID: 12102021
Well, poo.  I don't see any options for static linking under that compiler.  For your sake, I hope somebody else can tell you what my bifocals can't find.
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12102186
I don't think that it needs to be linked statically.

What I actually think happens is that the LIB file that contains *all* the source code gets built into the EXE instead of references to the code in the DLL.  I linked mine normally, the only linking explicitly specified was dynamic linking to the MFC DLL when I was using that.
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12103022
Include the DLL in the resource file of your application. (The *.res file) When your application starts, check if the DLL exists. If not, retrieve it from the resource file and write it to disk. When the application ends, delete the DLL from disk again. :-)

If you want to do it more advanced, it is possible to load a DLL just from memory so you don't need to write it to disk. But it's a bit too advanced for me...
0
 
LVL 4

Author Comment

by:wertyk
ID: 12109568
ok, its too much trouble. first person to tell me that it just cant be done gets the points.
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12109677
We need the source code if you want someone to build the application...
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12155554
If *you* are not going to put in the time and the effort to get this to work, then yes, I guess that this cannot be done.  But that is up to you :)
0
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 500 total points
ID: 12164707
I've provided you a way to include the DLL in the executable, so it becomes just a single file. All you need to do when the application starts is check if the DLL is there, if it's the right version and if not then override it with the version in the resource.

Create a file called YourProject.rc and add one line to it: GLUT DATA "glut32.dll"
Then add this file to your project. (By default it allows you to add *.pas files but you can also add *.rc files if you change the filter in the file dialog that you get when you add a file.)
Build the project and it will include the DLL in your executable. (Unless it cannot find glut32.dll which means you have to include the pathname to the DLL in the *.rc file, between the quotes.)

And you need to write code that reads the DLL from the resource (thus from itself) and writes it to disk. That would be all... If your friend later deletes the DLL, the exe will just generate it again...
0
 
LVL 4

Author Comment

by:wertyk
ID: 12183948
points go to alex. thanks!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is an explanation of a simple data model to help parse a JSON feed
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now