469,902 Members | 1,824 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,902 developers. It's quick & easy.

trivial question about building exe

Hello

I have got windows application project (C# Visual Studio 2003) with
references to external dlls. All I want is to compile everything into one
exe file, so that I can send it to another machine and it works.
I would also ask about creating installation package so that others could
install my application.

Best Regard

Dariusz Tomon
Mar 9 '06 #1
4 1436
On Thu, 9 Mar 2006 18:38:58 +0100, Dariusz Tomon wrote:
Hello

I have got windows application project (C# Visual Studio 2003) with
references to external dlls. All I want is to compile everything into one
exe file, so that I can send it to another machine and it works.


This is not a trivial thing to do. If you have the source code of all the
DLL (and if they are all .NET assemblies), then you could place their
source files in your exe project and remove all the DLL references. Note
that the user will still need to have the appropriate version of the .NET
Framework installed on their machine.

If you can't do that, then you'll need to buy some tool that can place
everything in one exe file and dynamically extract the DLL files when the
application is run. These tools usually don't come cheap (although i have
never researched this issue thoroughly) and there is obviously a
performance hit in doing that.

Alternatively, what you could do is create a setup program packaged in one
exe file that would install the application and all its DLLs on the user's
PC. There are loads of software that you could use to do that
(InstallShield, Setup Factory, Inno Setup...) both free and commercial.
Google will tell you more.
Mar 9 '06 #2
Just use a setup and deployment project.

Place the outputs of all your DLL's etc in there and build an MSI.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Dariusz Tomon" <d.*****@mazars.pl> wrote in message
news:uU**************@tk2msftngp13.phx.gbl...
Hello

I have got windows application project (C# Visual Studio 2003) with
references to external dlls. All I want is to compile everything into one
exe file, so that I can send it to another machine and it works.
I would also ask about creating installation package so that others could
install my application.

Best Regard

Dariusz Tomon

Mar 9 '06 #3
Dnia 09-03-2006 o 18:38:58 Dariusz Tomon <d.*****@mazars.pl> napisał:
Hello

I have got windows application project (C# Visual Studio 2003) with
references to external dlls. All I want is to compile everything into one
exe file, so that I can send it to another machine and it works.
I would also ask about creating installation package so that others could
install my application.

[PD] If I understand you correctly you want to compile all dlls to one
file. In other words you want to link *dynamic* libraries statically. This
is not the way you should use dynamic libraries but if you are sure you
know what you are doeing you can theoretically add all the libraries to
the resources of your application and get them from the resources and save
them to disc before your application will use them.
To create installation package use New\Project\Other Project Types\Setup
and Deloyment (at least in VS 2005, as far as I remember it looks similar
in VS 2003). BTW it is much better idea to create and distribute a setup
package (i.e. single msi file) than to try to stuff all the dll's into the
exe file...
--
Piotr Dobrowolski
Piotr.Dobrowolski@_usun_gmail.com
Mar 9 '06 #4
Dnia 09-03-2006 o 20:22:15 Piotr Dobrowolski
<Piotr.Dobrowolski@_usun_gmail.com> napisał:
Dnia 09-03-2006 o 18:38:58 Dariusz Tomon <d.*****@mazars.pl> napisał:
Hello

I have got windows application project (C# Visual Studio 2003) with
references to external dlls. All I want is to compile everything into
one
exe file, so that I can send it to another machine and it works.
I would also ask about creating installation package so that others
could
install my application.

[PD] If I understand you correctly you want to compile all dlls to one
file. In other words you want to link *dynamic* libraries statically.
This is not the way you should use dynamic libraries but if you are sure
you know what you are doeing you can theoretically add all the libraries
to the resources of your application and get them from the resources and
save them to disc before your application will use them.
To create installation package use New\Project\Other Project Types\Setup
and Deloyment (at least in VS 2005, as far as I remember it looks
similar in VS 2003). BTW it is much better idea to create and distribute
a setup package (i.e. single msi file) than to try to stuff all the
dll's into the exe file...

[PD] Of course if you want to go "resource way" your exe cannot have
static dependency of the dlls, it must load them dynamically or you will
have to crate second exe with your exe and dlls in resources, which will
unpack everything and run the firs exe :) Either way it is a bad idea :)
--
Piotr Dobrowolski
Piotr.Dobrowolski@_usun_gmail.com
Mar 9 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

25 posts views Thread by Brian Patterson | last post: by
12 posts views Thread by David Lindsay | last post: by
1 post views Thread by bml | last post: by
24 posts views Thread by Charles Ulrich | last post: by
3 posts views Thread by baibaichen | last post: by
4 posts views Thread by Edward Diener | last post: by
11 posts views Thread by =?Utf-8?B?Z3V5?= | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.