Let's see how to install custom component in Delphi (into existing package). Supose we have only one .pas file with component code.
Difficulty Level: easy Time Required: 5 minutes
Here's How:
- Start Delphi and select Component | Install Component...
- This will invoke the "Install Component" dialog.
- In the "Unit File Name" edit box enter the name of the unit you want to install.
- If the unit is in the Search Path, a full path name is not required. If the unit directory is not in the Search Path, it will be added to the end.
- The "Search Path" edit box displays the path used by Delphi to search for files. Leave this as it is.
- Use the "Package file name" drop-down list to select the name of an installed package.
- Click on OK.
- Delphi will prompt you whether you want to rebuild the modified package or not.
- Click on Yes.
- After the package is compiled, Delphi will show you a message saying that the new TSomeComponent component was registered and already available as part of the VCL.
- Close the package detail window, allowing Delphi to save the changes to it.
- The component is now available in the components palette.
- Drop the component on a form, and simply: use it.
- In step 3, you can click on the Browse button to browse for the component (unit)
- In step 6, default package is "Borland User Components", there is no special need to alter this.
Related Features:
- TFindFile - Delphi Component - Tired of using FindFirst, Next and Close? Come see how to encapsulate all those functions in a single "find-files-recursively" component. It's easy to use, free and with code.
- How To Create the Basic Unit for a New Component
- More Delphi Programming HOW TOs

