This is the first time in Alan, there is an incorrect place, welcome to discuss the correct.
First, you have to correct a wrong conclusion: You must bring VCLXX.BPL as long as the program uses Borland's package.
Not too!
If you want to use DLL to implement functional module segmentation, you have a painful experience: you can't export classes; you can't share the global variables of the main process; you may want to pass a lot of parameters when calling the DLL; you are upset to PCHAR; .
Borland solves these pain by packaging Borland Package Library, here we only discuss runtime packages.
Aliang has studied the package of Delphi 5 in 2003, and successfully split a large system into a single runtime package file, then I wanted to recompile VCL50.bpl, no Success, very unwilling! Delphi 7 was installed in the first day, I want to try again, the result is actually successful, that is, you can write a small EXE file (this is very attractive for some programmers, they want their own The smaller the program, the better, even when it is obsessed, and Alan is also one of them), how can you? For example, 20kb EXE, this main program is just a frame, it may contain only one main window, initialize the global structure or variable required for applications, realize the code that is dynamically loaded and uninstalled, and takes at least one recompiled VCL. Package, of course, this VCL package may contain all the standard units provided by Delphi, or only the units required for your application.
The application structure you may publish may be the following structure:
App.exe (* Main Program *)
Borland.bpl (* Re-compiled Borland VCL Unit Runtime Pack *)
Common.bpl (* Application Public Pack, all global structures and unit definitions and implementation in this package, the main program and module package common units for this package to achieve global sharing *)
Module1.bpl (* Module 1 *)
Module2.bpl (* Module 2 *)
...
BORLAND.BPL and Common.bpl are static loading, that is, the two files must be found in the path that App.EXE can be found when app .EXE is loaded by Windows, typically the same files as app.exe. The clip or Windows System folder.
Module1.bpl, moudle2.bpl ... is a need for dynamic loading, this is very important for the scalability of an application system! The functional structure of the application system has decisive significance. In theory, as long as you take the main frame, the module is not limited, you can use this framework. The basis is based on the inventory system, and it can also be a graphics system, or a complex ERP system, which is determined by the module package you posted.
Said so much, now we start to recompile RTL70.bpl, this package is the ancestors of all VCL packages (at least Delphi 7 is like this), which includes some important base units, such as Windows, Sysutils, Classes, etc., and this package is The only runtime package that does not rely on other runtime packages.
Open Delphi 7
1. Turn off the default project created by Delphi (if any);
2, File-> New-> Other, choose Package;
3, New a form, compiled once;
4, switch the window back to Package - Pacakge1.dpk; 5, double-click RTL.DCP under the Requires node, will get RTL.DPK;
6. Press F12 to switch to the RTL.DPK source code, save it as d: /delphi.dpk;
7, Close All;
8, Open D: /Delphi.dpk, change the Output DireTory and DCP Output Directory folders in Options.;
9, compile it, remove the Varhlpr, Strhlprpr, deleted Varhlpr, Strhlprpr, and Alan, I don't know if this two orders are used, and then delete it;
10, compile success, two files in D: / Generate Delphi.bpl and Delphi.dcp, other cell names such as VCL, VCLX, VCLDB, etc., can also be obtained, add to Delphi.dpk Re-compiled.
In this way, there is no need for files such as VCL70.bpl, RTL70.bpl, vClx.bpl, etc. when the application is released. It is a delphi.bpl.
Of course, everything is favorable:
1. If the common package is recompiled, the main program and all the module packs may need to recompile, so the structure of the previous shared package and the main program framework should be considering and complete;
2, if you use a third-party control, select those active controls because their runtime packs must be recompiled, remove the bags required for RTL, VCL, etc., change to delphi.bcp, this should be easy, Alan is re-compiling all files of DXEXPRESS to express.bpl. We are very fortunate! Not? In our era, these stuff is easy to find, and they all write great, why not!
3. You may need to write a tool to maintain the module version of the package to you;
4, if you have multiple applications published in the form of a dynamic package, workaround: First, install Delphi.bpl to the Windows System folder, let your app share this package; Second, release a Delphi for each app To the installation directory! ? This will have a thought of M $, which requires you to choose.
LIYL [AT] Founder [DOT] COM