I. IDE control
1. Disable the rtti reflection mechanism
Since delphi2010 introduced a new rtti reflection mechanismProgramThis is because delphi2010 adds a reflection mechanism to all classes by default. This function is not used in every project, so we can simply disable rtti reflection in the following ways to greatly reduce the file size.
The method for disabling is very simple, that is, to be in the project (DPR file. The project file in delphi2010 is a dproj file, but the DPR file is still written by default.CodeYou can add the following definitions before the uses statement:
{Disable the rtti reflection mechanism to reduce the size of the EXE file}
{$ If compilerversion >=21.0}
{$ Weaklinkrtti on}
{$ Rtti explicit methods ([]) properties ([]) fields ([])}
{$ Ifend}
2. Disable debug information (disabled by default)
Project-> options-> linking-> debug information-> disabled
Ii. Other Methods
1. reduce the size of the Delphi application
01) Use shelling tools (such as UPX and ASPack)
02) Use Kol
03) do not use VCL to write programs
04) Use ACL (API control library)
05) Use stripreloc
06) Remove the route debugging information and td32
07) Write allowed code to DLL
08) do not place images on the form during design, but load images at runtime.
09) use compressed images (JPG instead of BMP)
10) Reduce attributes in the DFM File