Solved

Delphi's EXE large file size

Posted on 2001-09-12
11
350 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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:mnasman
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Expert Comment

by:DelFreak
Comment Utility
Listening...
0
 
LVL 1

Author Comment

by:adam8
Comment Utility
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:mnasman
Comment Utility
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
Comment Utility
whats VCL and can it be compiled with the exe?
0
 
LVL 22

Accepted Solution

by:
mnasman earned 25 total points
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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