HOW TO INSTALL A COMPONENT ON DELPHI

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

HOW TO INSTALL A COMPONENT ON DELPHI

If you don't know how to install a component that does not have its own package, read the next post or follow the following link:
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Re: Don't know how to install a component?

Delphi 2007, 2009 always require dpk file.
ZardoZ
Member

Posts: 1
Joined: April 8th, 2009, 4:23 am
Location: Russia

Re: Don't know how to install a component?

To add a component that do not have its own package, you have to add the component's files in to a new or existing package, and then rebuild/install the package.

To create a new package on Delphi 2009 follow these steps:

1. From IDE menu bar select: File » New » Other...
2. Select Delphi Projects category from the tree, and then select Package, and press OK.
3. Rename the package to whatever you want. But remember to choose a unique name.
Renaming package
1.png (14.83 KiB) Viewed 16887 times
4. Right click on Contains section, and the click on Add... item to add component files (usually *.pas files) to the package.
2.png (10.13 KiB) Viewed 16888 times
5. Some components (those who define their own property editors) may need a reference for DesignIDE.dcp file. To do so, right click on Requires section, and then click on Add Reference... item. You can find DesignIDE.dcp in Lib path of your Delphi installation.
3.png (16.43 KiB) Viewed 16889 times
6. Now right click on the package's name, and select Install item to install the components. If the components are already installed, you should select Compile or Rebuild items.
Installing the package
4.png (17.25 KiB) Viewed 16888 times
7. Finally, save and close the package.

But it's not done yet. You have to be sure that the components' files are in search path of Delphi. Follow these steps now:

1. From the IDE menu bar select: Tools » Options...
2. Select Library - Win32 category, and then click button with ellipsis which is in front of Library Path.
Library Path
5.png (52 KiB) Viewed 16887 times
3. For each path components' (unit) files, enter or browse/select path in the edit box and then click the Add button.
6.png (28.5 KiB) Viewed 16887 times
4. And finally close two dialog boxes by clicking on the OK buttons.

Procedure of adding new packages/components to other versions of Delphi is more or less similar to Delphi 2009.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Re: Don't know how to install a component?

I followed the instructions but it failed at step 6 with the following message:

mjsmithsr
Member

Posts: 2
Joined: April 27th, 2009, 2:31 pm

Re: Don't know how to install a component?

Make sure DELPHIAREA.INC to be either in the same folder of component's units or in Delphi search path.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Re: HOW TO INSTALL A COMPONENT ON DELPHI

My problem is the same.Working with Delphi 2007, I can't install RotateImage, however I followed your instructions. At install, message is
DELPHIAREA.INC is in MyLib.
What can I do?
AbdiA
Member

Posts: 3
Joined: December 14th, 2010, 1:28 pm

Re: HOW TO INSTALL A COMPONENT ON DELPHI

Add DesignIDE.dcp to the required clause of the package. This file is located in Lib path of your Delphi installation.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Re: HOW TO INSTALL A COMPONENT ON DELPHI

Of course, I added DesignIDE dcp. to the required clause of the package (strictly followed the steps you wrote), and AFTER recieved 'File not found: DsgnIntf.dcu' message.
Must I add something else to the required clause ? Any idea?
AbdiA
Member

Posts: 3
Joined: December 14th, 2010, 1:28 pm

Re: HOW TO INSTALL A COMPONENT ON DELPHI

Check your DELPHIAREA.INC. In the Delphi 2007 unit named as DesignIntf
2B OR NOT 2B = FF - sometimes the code is only code (almost Duerf Omolhcs Dnumsigis) ©
The best plugin for FAR is Windows 7 ©

data man
Active Member

Posts: 5
Joined: December 6th, 2010, 2:19 am
Location: Outskirts of The Milky Way

Re: HOW TO INSTALL A COMPONENT ON DELPHI

It succeeded. Thank you for the help.
AbdiA
Member

Posts: 3
Joined: December 14th, 2010, 1:28 pm

Re: HOW TO INSTALL A COMPONENT ON DELPHI

Thank you very very very much Kambiz;
Baraka allaho fika ya rajol.
kaouane
Active Member

Posts: 14
Joined: January 12th, 2011, 5:02 pm
Location: Algiers, Algeria

Re: HOW TO INSTALL A COMPONENT ON DELPHI

Hi, sorry to ask such a stupid question, but I'm having problems getting FindFile demo to run in Delphi 2010.

I'm a very experienced Delphi developer (since 1985!!), but I almost never deal with installing or building components myself.

If I open the original DPR, then I immediately get the error :
Code: Select all
Field MainForm.FindFile does not have a corresponding component. Remove the declaration? (Y/N/C/H)

Interestingly, if I answer "No", the project compiles fine, but of course I get an invalid access error as soon as I click the 'Find' button.

So, if I follow the D2009 instructions for building a package using the FindFile.pas source, then install that package, I get a new component tab called "Delphi Area" with the new component showing.

However... if I add the component to the form, it automatically names the component 'FindFile1'. If I try to rename it, it tells me the component declaration already exists. So if I comment out the
Code: Select all
FindFile : TFindFile;
in the MainForm's class declaration, I can successfully rename the component. The project then compiles fine (as it does without the component, as described above).

However, then when I click 'Find' in the running application, nothing happens. Tracing the code, the component appears to be initialised, and performs a search, but uses null (empty) strings, not the strings entered in the main form's edit fields.

What am I doing wrong?

Again, I apologise for asking such a basic question; but without a good understanding of how components are supposed to work, and whether or not they need to be built when they obviously already exist in the calling source, is really confusticating for me!

Thanks in advance for any suggestions.

Oh, yeah, I'm running this on Win7 x64 Premium, on a Core i5 2.9GHz (Gigabyte Z68X-UD3H-B3 mobo), with 16G physical RAM and all bog-standard config settings.
PCPete
Member

Posts: 1
Joined: March 14th, 2012, 4:50 am

Re: HOW TO INSTALL A COMPONENT ON DELPHI

Because you have already opened and saved the demo before installing the components, the demo file is corrupted.
Kambiz

Kambiz