Solved

Delphi's EXE large file size

Posted on 2001-09-12
11
358 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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
 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…

832 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