Delphi 5 install package




















Delphi 5 Installation and Components Packages. Re:Delphi 5 Installation and Components Packages. Other Threads 1.

Package installation problem not a design time package 2. Delphi 3 component help installation 3. Delphi 3rd Party Component Installation problem 4. Command line package installation 5. PC-Install--professional installation package 7. You don't have to do anything to "use" a design time package. You just drop a component on the form and the code is taken from the package and linked into your project.

Again: you then don't have to ship the package file with your project. Things are a little different with runtime packages. This procedure is called when the package is installed with Delphi. It tells Delphi the class name of the component s to install and the name of the page on the palette where the component should appear. If the author of the component wrote some nice property editors for his component, they are registered here as well.

A runtime package MAY NOT contain such design time code because the design time stuff relies on code that is not available for runtime packages. If it does, you most probably won't be able to compile the runtime package. You need to split the code into two units. The author of the component will most probably have done that. If it's your own work, you need to do that. The first unit contains the component's source code only without the register procedure. You can add this unit to a runtime package and compile this package.

Now you need to install the component in Delphi to be able to use it. You do so by adding the other unit the one that contains the property editors and the Register procedure to a design time package, which you later install. You may have to "tell" the package manually that it requires the runtime package. Now you can work with your component like you normally would.

If you build your project without runtime packages see project options , the code is again taken from the package and statically linked. You don't have to redistribute the runtime package file. HOWEVER, if you tell the compiler to use runtime packages, you'll need to redistribute the runtime package you created above!

Please note that this is a "one way problem". You can add units that contain property editors, component source code and the register procedure to a design time package. You can also add components that are split up like described above to a design time package you just need to add both units to it. But you can't add a unit that contains the design time code to a runtime unit.

First of all, how are the packages used by the Delphi IDE? I understand design time and runtime packages and how to use them - thank god. And my understanding of the DPK is he keeps info on source units so they can be compiled into a project.

I've seen package clauses in source units, but there must be additional magic which takes place besides simply specifying the DPK in source. Thanks for the useful advice. No problem - this is kind of essential, so I think you should know Well, nearly, but not quite.

Before I continue I have to correct what I said before: it seems like you can add any kind of unit to a package. I'll explain this later. First of all, you can use units that are not part of a package. That is true for both "normal" units and component units. You can even use components that are not part of a package, but then you MUST create them manually at runtime and can not use the Object Inspector at design time. To do THAT, the component unit must be installed into a package, which is then installed in Delphi that's what I explained last time.

Units you use without adding them to a package must of course reside somewhere in the library path. That means, the Delphi IDE does not "know" about components unless they are included in an installed design time package. For Delphi, a design time package is like a plugin from which it takes information about the components it displays on the palette and where the corresponding compiled units can be found for static linking.

This doesn't seem to have any effect on the unit files, meaning: you still need the unit files for all the components and units included in the package, as Delphi needs to statically link them into your project. Runtime packages contain compiled unit source code that is available at runtime. Like a DLL exports a set of functions and procedures. You can not install runtime packages in the IDE, but you can create a design time package that contains the code to register components with the IDE that are part of the runtime package.

So the runtime library acts like a DLL for the design time library the RT package contains the code, the DT package contains information for Delphi on how to use that code. That is: code from standalone units, code from units in design time packages AND code from runtime packages.

The latter is taken from the runtime packages DCP file. You get a single exe file that does not require any additional runtime packages. You can edit this list. For example, you can instruct Delphi to use no runtime libraries but the one that contains your own components. Delphi then takes code from standalone units, units that are part of design time packages and units that are NOT part of the runtime libraries you have selected and statically links it to your exe. Then it creates references to any code that is contained in the runtime libraries you've selected and links them into your project.

Now you get an exe file that is smaller but requires one or more additional runtime libraries. Example 1: you are NOT using any third party components, but only components that were installed during the Delphi installation. You tell Delphi in the project options to use ALL standard runtime packages for compilation, then your exe would be very small, but depending on the components you use you'd have to distribute one or more runtime packages.

You're building with runtime packages. Presumably, your exe size wouldn't change much, but you'd have to redistribute VCL 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.

Actually, it's not required - you can eliminate this step by making sure that the. If the. 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. What about the built-in component installer? You can instal into an existing package or into a new one, which it will create for you.

I would say that the best way to install components is to use your build manager for example FinalBuilder and add each component to a manager-project file which sets the necessary paths, builds the DPK files, and 'installs' the component in the IDE by making a registry entry. That way you have a documented procedure which allows you reliably to set up or repair your complete, tested, Delphi development environment. You can simply re-run the project when a component has been updated and tested.

It is also quite easy to tweak an existing project to handle a new Delphi version. The big disadvantage of a vendor-supplied installer is that all the ones I have seen simply overwrite the previous version on updates.

I prefer to control the install myself, so that I have previous component source versions archived and available for comparison, in case testing reveals a problem with an upgrade.

The 'one-click install' sounds fine, until a minor component upgrade suddenly causes your application to stop working. Take a look at " Lazy Delphi Builder ". Packages allow you to rearrange where code resides without affecting the source code. This is sometimes referred to as application partitioning.

Runtime packages provide functionality when a user runs an application. Design-time packages are used to install components in the IDE and to create special property editors for custom components.

A single package can function at both design time and runtime, and design-time packages frequently work by referencing runtime packages in their requires clauses. On Win32, package files end with the. Ordinarily, packages are loaded statically when an applications starts.

Each package is declared in a separate source file , which should be saved with the. A package source file does not contain type, data, procedure, or function declarations. Instead, it contains:. The requiresClause and containsClause are both optional. The requires clause lists other, external packages used by the package being declared. It consists of the directive requires , followed by a comma-delimited list of package names, followed by a semicolon.

If a package does not reference other packages, it does not need a requires clause. The contains clause identifies the unit files to be compiled and bound into the package. It consists of the directive contains , followed by a comma-delimited list of unit names, followed by a semicolon. Any unit name may be followed by the reserved word in and the name of a source file, with or without a directory path, in single quotation marks; directory paths can be absolute or relative.

For example:.



0コメント

  • 1000 / 1000