Delphi – Preventing the IDE from changing a package’s “requires” clause

delphidelphi-2009

I have a shared runtime package that I am using to support an application that uses packages as a plugin system. I have included several third party units in the shared package to reduce the number of BPLs that have to be distributed.

Delphi seems to have some headaches with this set up, occasionally updating only the DCP file in the "shared DCP" area (C:\Users\Public\Documents\RAD Studio\6.0\Dcp on my machine) and not the one in the DCP output directory (as specified in the project options).

That isn't my main problem though… My main problem is that Delphi throws up this dialog quite often:

Delphi Change Package Dialog

(this is just an example, it happens for other packages I have installed as well)

Now, in Delphi 2009, at least when I cancel this dialog (and click yes on the dialog that comes up next), it doesn't change anything. Previous versions would still proceed to munge my dpk file.

I currently can't get the damned dialog to stop coming up. The package is set as a runtime package, it does not have any packages "required" (other than the VCL ones). I thought I had it licked a month ago, but it has started coming up again.

There are no changes to the DPK file or the DPROJ file.

I know why it is doing it… Delphi is trying to keep this package internally consistent with other packages in the IDE, just in case I install it. I would like to stop the IDE doing this.

Does anyone have any suggestions?

N@

Best Answer

You should explicitly reference each of the units mentioned in the dialog in the contains section of the DPK file. The dialog only shows units that are implicitly (= not listed in contains) included and suggests requiring the package they originally belong to.

Related Topic