Delphi Clinic C++Builder Gate Training & Consultancy Delphi Notes Weblog Dr.Bob's Webshop
Bob Swart (aka Drs.Bob) Dr.Bob's Delphi Clinics Dr.Bob's Delphi Courseware Manuals
View Bob Swart's profile on LinkedIn Drs.Bob's Delphi Notes
These are the voyages using Delphi Enterprise (and Architect). Its mission: to explore strange, new worlds. To design and build new applications. To boldly go...

_Fun with package description strings in D2007

Author: Bob Swart
Posted: 2/15/2008 11:36:37 AM (GMT+1)

A client and friend of mine asked my help in solving a problem regarding a Delphi Win32 package which was migrated from Delphi 7 to Delphi 2007 for Win32, but would refuse to remain installed in the IDE. It took me only a short time to figure out why: the package description string he used contained an underscore as first character:

 <$DESCRIPTION '_This Package will not be loaded'>
As a result, the package would be the first one in the list of installed packages (that's always nice to see), and you could compile and install it, and it would work just fine. During that session of Delphi.

However, if you close and restart the IDE, then Delphi 2007 will notice that the package description starts with an underscore and it will not load the package. The reason is that the IDE uses the underscore character to determine if the package is known and should be installed, or if it's only a "known" package.

The complete list of known packages - installed or not installed - can be seen in the registry at:
  HKEY_CURRENT_USER\Software\Borland\BDS\5.0\Known Packages
And as a test, you can place underscores in front of descriptions to make sure packages are not loaded (and if you uncheck the checkbox of a package in the IDE's Install Packages dialog, the result is that the description in the registry will get that underscore prefix).

I must admit that I'm not sure if this is documented or not, but I cannot remember having read a warning like "do not give your packages a description that starts with an underscore" before ;-)

This feature was introduced with Delphi 2007 (and CodeGear RAD Studio), so it's something to keep in mind when migrating packages from older versions of Delphi like Delphi 7 or even Delphi 2006 to Delphi 2007 and/or RAD Studio!



TOndrej 08/02/15 13:10:33I've seen this some time ago mentioned on the newsgroups and since then I use it very often to quickly enable/disable some design packages in my IDE: I just go to the "Known Packages" registry key and edit the description of the package. Quite neat and handy. I think the same happens with an empty description: the package won't be loaded in that case. You can even script it with reg.exe command line utility from the Windows resource kit.
Xepol 08/02/15 17:49:11I have seen this documented somewhere, but it elludes me currently. Maybe Nick or someone on the documentation team at CodeGear might know.
Hallvard Vassbotn 08/02/15 20:54:40One reference is here:
Bob Swart 08/02/15 21:20:22Thanks for that reference, Hallvard, I hadn't seen that one before...

New Comment (max. 2048 characters, no HTML):


This webpage © 2005-2017 by Bob Swart (aka Dr.Bob - All Rights Reserved.