Solved

Delphi's EXE large file size

Posted on 2001-09-12
11
382 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 34

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

691 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