473,467 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1569
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Brian Patterson | last post by:
I have noticed in the book of words that hasattr works by calling getattr and raising an exception if no such attribute exists. If I need the value in any case, am I better off using getattr...
12
by: David Lindsay | last post by:
I want to put date and time on my web page, and to be sure it tracks the BST/ GMT changes. Can anyone help me, I have gone back in my historic file for quite a while and not found anything. Sorry...
1
by: bml | last post by:
Is "Trivial constructor" either a default constructor generated by compiler or the one you write but it does nothing (empty inside method definition)? Is it required by C++ standard to bypass...
24
by: Charles Ulrich | last post by:
Greetings, I hope my greenness isn't showing too bad by asking this, but I ran across this trivial program today that left me flabbergasted: #define MESSAGE "This account is currently not...
3
by: baibaichen | last post by:
hi, i am reading a C++ book, it mentions a term non-trivial object. what i understand is: if a object has: a) trivial constructor b) trivial assignment operator c) trivial destructor then it...
2
by: Diffident | last post by:
Hello All, I just finished reading an interesting article by Scott about App Domains: http://odetocode.com/Articles/305.aspx Scott, I have a question about the section "Shadow Copies and...
4
by: Edward Diener | last post by:
When I try to find out if a trivial event has handlers, by comparing the event to nullptr, I get compiler error C3918. So my natural question is how does one test a trivial event for handlers ?
2
by: Eric Lilja | last post by:
As the topic says, I wanted to make a re-usable singleton class that could create pointers to objects with non-trivial constructors. I came up with this: #ifndef SINGLETON_HPP #define...
11
by: =?Utf-8?B?Z3V5?= | last post by:
Just a though but three trivial changes which I would like to see in VB:- 1- Make Null a synonym for Nothing, progressively phasing Nothing out, you have to know null anyway so why not use it in...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.