I\'m writing a package in Delphi 2007 containing a component and several classes. I want to \"install\" the classes as well as the components.
To be more precise: wh
To be more precise: when a component is installed, the unit is somehow registered such that it is not necessary to add its path to the search path in the project.
The unit is not registered anywhere. When a component is installed, the bpl package in which it resides is added to the known packages list when the IDE starts, it will call all the Register procedures (note the capital R) in each of the known packages. These Register procedures contain code to get the components registered on the tool palette.
If you set up the component package(s) correctly, the IDE will also know which units to add to a form's uses clause when you drop a component on a form.
The library path in the environment options is not part of all this. If it is being amended by installing a component, that is being done by the component's installation program as a separate action in addition to adding the component's bpl to the IDE.
Would adding it to dcluser.dpk
and compiling that be enough for you?
When I create a simple component package, I usually set "Unit Output Directory" package option to $(BDSCOMMONDIR)\Dcp instead of adding paths to Library paths - it is more simple. You can download my ksTools package as an example - it is pure source code package with detailed installation instructions
The IDE will also need to know where any DCU's associated with the package are stored. This wil mean having to add the actual path (where the DCU's are located) to the IDE's "Library Path", or storing them in a location that is already registered as a Library Path.