Brian Frost
Brian Frost

Reputation: 13454

Is the key order important in the Delphi key 'Known Packages'?

I'm trying to save some Delphi setup info to speed up Delphi installation and I'm getting very confused with registry key value order behaviour. I exported my Delphi XE2 registry key:

HKEY_CURRENT_USER\Software\Embarcadero\BDS\9.0\Known Packages

to the *.reg file. After deleting it from the registry, and reloading the reg file, Delphi complains about missing bpl's. When I look at the key list, it is now all in alphabetical order - it is NOT in that order in the reg file. I presume that where packages depend on another, the depended package must be listed first. Am I right?

I then used Inno Setup to create three key values in this order - B,A,D. After running it, the registry displays A,B,D key order.

As a component installer I've rarely had dependent packages. What method can I use to leave the keys in the order I chose? Something must have done that because I have a reg file in the order that Delphi requires. It seems crazy that an export followed by an import is not symmetrical.

Upvotes: 2

Views: 515

Answers (1)

Jeroen Wiert Pluimers
Jeroen Wiert Pluimers

Reputation: 24513

As you found out, this indeed is has to do with registry enumeration order versus alphabetical order.

Delphi loads the packages in enumeration order, which is not always the alphabetical order.
I haven't found a registry editing tool yet that shows the enumeration order, they always seem to show the alphabetical order.

This matters especially when:

  1. BPL files are not on the PATH, and Delphi cannot resolve the depending BPL files itself.
  2. The dependency order is different than the alphabetical order

When you cannot put the BPL files on the PATH, then you should add the registry values in the order you want to have the BPL files loaded (you probably need multiple sections with the same key to do that).

Or you should make the dependency order alphabetical (;

Upvotes: 4

Related Questions