Runtime Packages


When you create a new Delphi VCL Forms application and compile it, the compiler will produce a 376 KB executable. But when you create a new C++Builder VCL Forms application and compile it, the compiler will produce a 29 KB executable file.

This enormous difference in the size of the executable is not because of the quality of the C++ compiler or defects in the Delphi compiler. The only reason this size difference exists is because of the default project settings.

By default, the Delphi compiler compiles all used VCL components and code into the executable file, which makes the file standalone and large. Such an executable file can be easily distributed because it doesn't require additional files to run.

Default C++Builder settings, however, tell the C++ compiler not to compile the VCL components into the executable but to use them from their runtime packages.

When you compile a C++ or a Delphi VCL Forms application with runtime packages, the executable file is no longer standalone and is much smaller. An executable file compiled with runtime packages cannot be distributed as easily as a standalone executable because, in addition to the executable file, you also have to distribute the runtime packages that contain components used by your application.

To compile a VCL Forms application with or without runtime packages, display the Project Options dialog box (Project ® Options), click on the Packages node on the left to display package-related options, and then check or uncheck the "Build with runtime packages" check box.

image from book
Figure 11-29: Building with or without runtime packages

Unless you're building an application suite with several executable files, you're better off building your applications without runtime packages, because the overall size of the application will be smaller.



Inside Delphi 2006
Inside Delphi 2006 (Wordware Delphi Developers Library)
ISBN: 1598220039
EAN: 2147483647
Year: 2004
Pages: 212
Authors: Ivan Hladni

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net