Solved

Delphi's EXE large file size

Posted on 2001-09-12
11
352 Views
Last Modified: 2010-04-04
Hi,
I just started Delphi and compared to Visual Basic and Visual C++ the file size is huge. If I compile a file will I be able to execute it on any computer without any dependancy files. Is this why the file size is so big.

Also if I use activex controls would I need to include them in the setup file of the finished app..
0
Comment
Question by:adam8
11 Comments
 
LVL 1

Author Comment

by:adam8
ID: 6478294
Is there a way to make the file sizes smaller?


PS. I am using Delphi 5 Enterprise with Update Pack 1 installed.
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6478314
Two ways:

1. go to Project -> Options -> Packages
   check Build with Runtime packages

   You will now notice that your Delphi app is *very* small... 50KB perhaps. The downside of this is that you would now have to distribute the necessary .bpl files to your client computers as well. As for VB and VC, M$ already includes the runtime files in the OS... well, that's Microsoft for you...

2. pack the EXE file using an EXE compressor

   There are many executable compressors available, the more notable one would be UPX (Ultimate Packer for eXecutables). What the compressor does is, it will compress your EXE file, and when you execute the compressed EXE file, it will decompress itself in memory.

check out UPX at http://upx.sourceforge.net




DragonSlayer
0
 
LVL 5

Expert Comment

by:Gwena
ID: 6478325
You can get exe's down to as low as 14kb if you use the KOL library and the free exe compressor UPX
look at a file named 'file-combiner-util' on my site.. it's a 20kb delphi app that uses KOL... this app needs no runtime file to run. My site is
http://delphi.does.it

Kol is at http://gregor.mastak.ru/~kol/
0
 
LVL 33

Expert Comment

by:Slick812
ID: 6478373
why so big? Since you have the Delphi 5 Enterprise edition you can look at the source code for the Forms.pas unit, which is what adds many of those Kbs to a project. I have come to beleive that delphi wanted to make their apps "Strong" and "Reliable", not prone to crash or failure. So there may be alot of of unused code included in their apps for safety, just in case you make calls to create controls (there are many) at runtime and other reasons. I think the delphi compiler and linker are very good, so if you want a smaller app you can create one that does not include unneeded code, by codeing a windows API program with the .dpr file. However you give up the Rapid Application Developement conveince and have to hand code all the windows message handling and window creation options, Very time consuming. There is a web site that has the Key Objects Library, which will integrate into delphi and let you make smaller apps, , , , at
http://bonanzas0.tripod.com/
- - - - - - - - - - - - - - -
but my point of view is that apps are now easily a megabyte (VB with the librarys), and puters have 64 megs or more of memory, so the file size don't much matter like it used to with 1 gig hard drives. So let the Kbs Roll !. . . And I use UPX myself
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6478511
Hello

  When you create sample project with VB, it's take around 16kb, but when you create the same project with delphi, it will take around 270KB, but in delphi you don't need to distrubte any RUN TIME LIBARAY, but in VB you need to distrubte them, for VB 6 it's called msvbvm60.dll size around 1.3MB this file not found in the system your vb project will not compile.

 if you use RAW API to develop appication your exe file will be very small 15-30kb and don't need any files to distrubte with, but it's hard way
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:DelFreak
ID: 6478605
Listening...
0
 
LVL 1

Author Comment

by:adam8
ID: 6479299
If I use a 3rd party activex control in Delphi will I need to distribute that file with the setup package, or will it include itself in the file?
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6479309
if you are using activex, you have to distruabte it with ur application, but you will find native delphi component for every thing you need, and that's doesn't need to distrbute them with ur application, also it's better to find the VCL component than to use ActiveX with ur application
0
 
LVL 1

Author Comment

by:adam8
ID: 6479390
whats VCL and can it be compiled with the exe?
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 25 total points
ID: 6479472
The VCL (Visual Component Library) it's the Libaray for all delphi component, and it's compiled with the exe
so if you want any tools from 3rd party always check to VCL not activeX
0
 
LVL 5

Expert Comment

by:alanwhincup
ID: 6480071
Have a look at this download:

http://www.torry.net/samples/samples/soft/window.zip

It is how to create a windowed program without the use of Forms.pas by creating the windows via API.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 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

10 Experts available now in Live!

Get 1:1 Help Now