Using Runtime Packages

<< Click to Display Table of Contents >>

Navigation:  Developer's Guide > Application Design Considerations >

Using Runtime Packages

One of Delphi's useful features is its support for "Runtime Packages." By using runtime packages, a Delphi application can spread several modules. These modules are BPL runtime packages used by the Delphi IDE itself. These packages are special DLLs dynamically loaded into the application memory space on demand. The size of the main application will be smaller, as any external BPL library will come to memory only when needed.  This feature also allows creating modular applications. You can divide your application modules and forms into smaller libraries which can be loaded in your code when they are needed.

 

uniGUI supports using Runtime Packages and this can be done easily by enabling Link with runtime packages in project options. Once this options is set you must make sure all uniGUI runtime packages are in the Runtime packages list.

 

Below is a list of all runtime packages that are used in a uniGUI application. XX stands for a number which corresponds to your Delphi version. For example, uniGUI25 for Delphi 10.2 Tokyo.

 

uniToolsXX
uIndyXX
uniGUIXXCore
uniGUIXX
uniGUIXXChart
uniGUIXXmCore
uniGUIXXm

 

It is important to remember that you must make sure that all of the above packages will be linked with your application dynamically. If you include only a subset of these libraries in the Runtime packages list, then it can lead to a situation where some of the uniGUI libraries will be linked statically while others will be loaded dynamically. This must be avoided. You need to either link all of uniGUI libraries statically or all of them dynamically.

 

clip0104

 

After this setting you will notice that the size of your project executable will be much smaller. For an empty uniGUI project in release mode, the executable size will be around 43KB. Compare that to several megabytes when the project is compiled normally without runtime packages.