How to install classes or units like components in Delphi 2007?

删除回忆录丶 提交于 2019-11-29 15:39:45

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

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?

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!