Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to install components?

Installing components under Delphi XE3 is a nightmare.

  • First I need to add source files to

    Tools -> Options -> Library

  • then I need to find a normal package and compile it

  • finally I need to find design time package and install it.

This is just quite tedious and error prone. Is there a nicer way to install components?

I have found Delphi Package Installer. Unfortunately it doesn't support Delphi XE3 or above.

I have heard that there is something similar which produces exe packages that install themselves (something like Inno Setup) but I can't find such thing.

like image 473
Tom Avatar asked Dec 09 '12 19:12

Tom


2 Answers

No. The steps above are required.

First, adding the file path to Tools->Options->Delphi Options->Library Path is so the compiler knows where to find the files to compile them. (Actually, it's not required - you can eliminate this step by making sure that the .dpk files are in the same folder as the .pas files, and that all .pas file names are listed in the includes section in the .dpk. If the .pas files are in a different location, you'll need to either use relative paths in the .dpk (eg., MyComponents in '..\Source\MyComponents.pas') or add the location of the .pas files to Project->Options->Delphi Compiler->Search Path.)

The next step (finding the "normal package") is in order to build the runtime package. It's required, because the design-time package (next step) requires the code that's in that package in order to function in the Form Designer. It's also needed when you decide to build your application with runtime packages, if you use the third-party components and want to distribute the runtime package for it.

The separate design-time package (the third step) is required because designtime code can only be used at design-time; there's nothing that can be distributed with an application if it's built with runtime packages and the package build in step 2 is one of them.

This has been the way components are installed since around Delphi 3 or so, and the requirement to separate out designtime code into it's own package started being advised in Delphi 5 and enforced in Delphi 6 (when they relocated much of the IDE designtime support into their own separate packages and stopped distributing the source for them).

There really are no other options, unless the vendor supplies pre-build designtime and runtime packages for you, or supplies an installer that will do all of the above steps. (Most don't.) But if you update your Delphi version, you'd still have to go through the steps above.

like image 159
Ken White Avatar answered Sep 19 '22 21:09

Ken White


What about the built-in component installer? It is part of Delphi XE, XE2 and XE3 and a description can be found here (I wrote it). It will even install components in C++Builder. You can instal into an existing package or into a new one, which it will create for you.

like image 31
Rudy Velthuis Avatar answered Sep 17 '22 21:09

Rudy Velthuis