Reputation: 3197
I am looking for an elegant solution how to prepare both IDE and build script of a Delphi 2010 project. For the moment I am able to create a custom registry key for this project with necessary Known Packages added to registry before starting IDE, yet most of the design time packages require runtime packages and there are errors during loading IDE (or when selecting packages in Install Packages window).
Moving all runtime packages into $(BDSCOMMONDIR)\Bpl works and this is the only place Delphi seems to look in when searching for package dependencies. Is it possible to force delphi to look for package dependencies in arbitrary, multiple locations? In example below these locations are: $(Projects)\Delphi2010\CommonControls\bpl\ and $(ExternalComponents)\Delphi2010\DevExpress\Library\Delphi14.
The registry file I use is:
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\CodeGear\ProductName\7.0\Disabled Packages]
[-HKEY_CURRENT_USER\Software\CodeGear\ProductName\7.0\Known Packages]
[HKEY_CURRENT_USER\Software\CodeGear\ProductName\7.0\Known Packages]
"$(Projects)\\Delphi2010\\CommonControls\\bpl\\CommonControls.bpl"="Common Controls"
"$(ExternalComponents)\\Delphi2010\\DevExpress\\Library\\Delphi14\\dcldxCoreD14.bpl"="ExpressCoreLibrary by Developer Express Inc."
"$(ExternalComponents)\\Delphi2010\\DevExpress\\Library\\Delphi14\\dclcxLibraryD14.bpl"="Express Cross Platform Library by Developer Express Inc."
"$(ExternalComponents)\\Delphi2010\\DevExpress\\Library\\Delphi14\\dcldxDockingD14.bpl"="ExpressDocking Library by Developer Express Inc."
"$(ExternalComponents)\\Delphi2010\\DevExpress\\Library\\Delphi14\\dclcxSpreadSheetD14.bpl"="ExpressSpreadSheet by Developer Express Inc."
"$(ExternalComponents)\\Delphi2010\\DevExpress\\Library\\Delphi14\\dcldxSBD14.bpl"="ExpressSideBar by Developer Express Inc."
"$(ExternalComponents)\\Delphi2010\\DevExpress\\Library\\Delphi14\\dcldxBarD14.bpl"="ExpressBars by Developer Express Inc."
"$(ExternalComponents)\\Delphi2010\\DevExpress\\Library\\Delphi14\\dcldxBarDBNavD14.bpl"="ExpressBars DBNavigator by Developer Express Inc."
"$(ExternalComponents)\\Delphi2010\\DevExpress\\Library\\Delphi14\\dcldxBarExtDBItemsD14.bpl"="ExpressBars extended DB items by Developer Express Inc."
"$(ExternalComponents)\\Delphi2010\\DevExpress\\Library\\Delphi14\\dcldxBarExtItemsD14.bpl"="ExpressBars extended items by Developer Express Inc."
"$(ExternalComponents)\\Delphi2010\\DevExpress\\Library\\Delphi14\\dcldxRibbonD14.bpl"="ExpressBars Ribbon controls by Developer Express Inc."
And a batch file to start IDE:
regedit.exe /S ProductName.reg
start "delphi" "%DELPHI2010%\bin\bds.exe" -rProductName
Upvotes: 2
Views: 1401
Reputation: 19356
All Delphi requires is that runtime packages are somewhere on the system path.
If Delphi seems to be looking only in the BDSCOMMONDIR folder that is because that is the only folder with your and your third party bpl's that is also on your system path.
So all you should need to do is add the values for both $(Projects)\Delphi2010\CommonControls\bpl\
and $(ExternalComponents)\Delphi2010\DevExpress\Library\Delphi14
to your system path.
However, the system path is limited in length. If you have enough component libraries this approach would soon eat that all up. So you really need to consider putting all your run-time libraries into a single directory. Or use two: (one for your own run-time libraries and one for third party run-time libraries.
And this does not need to be the default folder used for the BDSCOMMONDIR environment variable. You can override the folder to which the BDSCOMMONDIR environment variable points. Simply add an override using Tools | Environment options | Environment variables.
After adding the override to point to the folder where you want all your third party (run-time) libraries to go, recompile them. If the components are well behaved they should use the default settings for their output location and that means their bpl's should end up in the new location.
Upvotes: 4