Page 1 of 1

HOW TO INSTALL A COMPONENT ON DELPHI

PostPosted: November 26th, 2008, 11:59 am
by Kambiz
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:
http://delphi.about.com/od/vclusing/ss/installpasvcl.htm

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

PostPosted: April 8th, 2009, 4:31 am
by ZardoZ
Delphi 2007, 2009 always require dpk file.
Menu "Install Component" removed.

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

PostPosted: April 27th, 2009, 6:10 pm
by Kambiz
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 17471 times
  4. Right click on Contains section, and the click on Add... item to add component files (usually *.pas files) to the package.
    Adding files to the package
    2.png (10.13 KiB) Viewed 17472 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.
    Adding references to the package
    3.png (16.43 KiB) Viewed 17473 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 17472 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 17471 times
  3. For each path components' (unit) files, enter or browse/select path in the edit box and then click the Add button.
    Adding component's path
    6.png (28.5 KiB) Viewed 17471 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.

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

PostPosted: April 28th, 2009, 12:41 am
by mjsmithsr
I followed the instructions but it failed at step 6 with the following message:

[DCC Fatal Error] RotImgReg.pas(19): F1026 File not found: 'DesignIntf.dcu'

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

PostPosted: May 3rd, 2009, 1:28 pm
by Kambiz
Make sure DELPHIAREA.INC to be either in the same folder of component's units or in Delphi search path.

Re: HOW TO INSTALL A COMPONENT ON DELPHI

PostPosted: December 14th, 2010, 2:12 pm
by AbdiA
My problem is the same.Working with Delphi 2007, I can't install RotateImage, however I followed your instructions. At install, message is
'File not found: DsgnIntf.dcu'.
DELPHIAREA.INC is in MyLib.
What can I do?

Re: HOW TO INSTALL A COMPONENT ON DELPHI

PostPosted: December 14th, 2010, 2:32 pm
by Kambiz
Add DesignIDE.dcp to the required clause of the package. This file is located in Lib path of your Delphi installation.

Re: HOW TO INSTALL A COMPONENT ON DELPHI

PostPosted: December 14th, 2010, 7:13 pm
by AbdiA
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?

Re: HOW TO INSTALL A COMPONENT ON DELPHI

PostPosted: December 15th, 2010, 9:30 pm
by data man
AbdiA wrote:File not found: DsgnIntf.dcu'

Check your DELPHIAREA.INC. In the Delphi 2007 unit named as DesignIntf

Re: HOW TO INSTALL A COMPONENT ON DELPHI

PostPosted: December 16th, 2010, 2:46 pm
by AbdiA
It succeeded. Thank you for the help.

Re: HOW TO INSTALL A COMPONENT ON DELPHI

PostPosted: January 12th, 2011, 6:22 pm
by kaouane
Thank you very very very much Kambiz;
Baraka allaho fika ya rajol.

Re: HOW TO INSTALL A COMPONENT ON DELPHI

PostPosted: March 14th, 2012, 5:05 am
by PCPete
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.

Re: HOW TO INSTALL A COMPONENT ON DELPHI

PostPosted: March 24th, 2012, 2:49 pm
by Kambiz
Because you have already opened and saved the demo before installing the components, the demo file is corrupted.
Just download the component once again and run the demo.