How to reduce the size of the Delphi application (EXE)

Source: Internet
Author: User

In general, the EXE file generated by Delphi is larger than the volume generated by its programming language. This is mainly due to the reason for using VCL (of course, VCL has many advantages!) )
Here are a few ways to reduce the exe file size:
01) Use the shell tool (e.g. upx,aspack, etc.)
02) Use KOL
03) do not use VCL to write programs
04) Using ACLs (API Control Library)
05) Use Stripreloc
06) Removal of the operation of debugging information and TD32
07) write the allowable code in the DLL
08) do not place the picture on the Form at design time, but load it at run time
09) Use compressed images (use JPG instead of BMP)
10) Reduce the attributes in the DFM file
(Refer to the following link "How to make your EXE file more portable")
One) use the Tstringlist
Use the Minireg
01)
UPX is a free, lightweight, scalable, and high-performance executable file Shell tool that supports a variety of different executable file formats. It achieves a very good compression ratio and can be decompressed very quickly.
http://upx.sourceforge.net/
The Aspack is an advanced Win32 executable file compressor that reduces the size of 32-bit Windows programs by up to 70%. (Aspack compression ratio improves the ZIP file format Industry standard 10-20%) aspack makes Windows 95/98/nt programs and libraries smaller, reducing the amount of network traffic. It can also protect programs to some extent from the reverse engineering of those non-professional hackers. The compressed program basically has no performance impact at run time.
Http://www.aspack.com/aspack.htm
{****************************************************************}
02)
KOL-(Key Object library key Objects) is a set of object libraries for Delphi to develop a powerful 32-bit Windows graphical user interface application. It can make the program smaller than it is developed with VCL.
http://bonanzas.rinet.ru/
{****************************************************************}
03)
Do not use VCL
If you want to implement a thin EXE file, do not use Vcl,delphi fully allows you to invoke the WINAPI function to achieve the rich functionality of Delphi 100%.
http://nonvcl.luckie-online.de/
Http://www.erm.tu-cottbus.de/delphi/stuff/Tutorials/nonVCL/index.html
Http://www.swissdelphicenter.ch/en/delphizeus
http://www.tutorials.delphi-source.de/nonvcl/

{****************************************************************}
04)
ACL (API control repository API Controls library)
It is entirely possible to write programs purely in the API, but I want to achieve two goals-writing thin programs and generating new control libraries, and when writing programs, I create my own twincontrol and all of the standard Windows control classes.
Http://www.apress.ru/pages/bokovikov/delphi/index.html
{****************************************************************}
05)
Stripreloc is a free (GPL license) command-line application that removes redundant Win32 (". Reloc") files from the PE format to reduce their size. Most compiler/linker programs (including Delphi) write the Reset section in the exe file, but because the EXE file will never be redeployed, this section will only waste space.
http://www.jrsoftware.org/striprlc.php
{****************************************************************}
06)
Removing debug information
Debug information takes up a portion of the space, and for the final release, it is entirely possible to avoid this part of the information.
Delphi IDE Menu
Project-options-compiler-debugging and
Project-options-linker-exe and DLLs Options
Remove the following two items to reduce the file size
"Include TD32 Debug Info" and "Build with runtime packages".
{****************************************************************}
08/09)
For pictures
It is best not to add pictures to the form during the design period, especially large images, since Delphi will also compile the images into your executable file, thus increasing the size of the EXE file. It is recommended to load the picture in real-time, in code, at run time.
{****************************************************************}
10)
How to make your EXE file more portable:
Http://www.undu.com/DN970301/00000064.htm
{****************************************************************}
11)
Use Tstringlist
Use Minireg
This article from the Delphi window, the original address: http://www.52delphi.com

How to reduce the size of the Delphi application (EXE)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.