How can I Generate Setup Installation in Rad Studio? - delphi

What files must I add while building the installation file in Rad Studio using Advanced installer? When I chose the project file, I launched the file created with Advanced Installer, but it says that:
file_name.bpl missing
What should I do ?

If you don't build with runtime packages (Project->Options->Packages->Runtime packages->Link with runtime packages is False), then you only have to distribute your application executable (.exe).
If you build with runtime packages (Project->Options->Packages->Runtime packages->Link with runtime packages is True), you have to include those packages when you distribute your application executable (.exe). This requires at a minimum that you include the VCL and RTL packages (vclXXX.bpl and rtlXXX.bpl, where XXX depends on the specific version of RAD Studio that you're using).
Depending on what your application does, you may also have to include other runtime packages in your installer. You can find the list of packages that your application needs by looking at the runtime package list in Project->Options->Packages->Runtime Packages->Runtime packages (click the ... button to open the dialog).
For more information, see the RAD Studio documentation topic Deciding Which Runtime Packages to Use.

You should be able to find a list of names of the packages used from the menu at Project/Information for YourApplication This list should be available once the project has successfully compiled and linked.
Even more useful may be the Project/Deployment menu item. This item is designed to actually deploy your application and its files to a remote machine using paserver, and perhaps could be used to do that in the process of making your installation file.
However, the big advantage of Project/Deployment is that it lists not only the name of each file, but also the Directory where that file can be found.
It looks to me like there may be files under Project/Deployment, such as localization language files, that might not always be needed, so I would cross-check Project/Deployment (which shows the Directory) with the Project/Information for YourApplication list. However, Project/Deployment is where I would look to find the directory where the missing file_name.bpl that Advanced Installer needs can be found.

Related

Delphi Jedi components manual installation

I'm using Delphi CE 10.4, and it has the DCC32.exe disabled line compilation.
I'm trying to manually install Jedi components, in the readme of JCL it says that it's needed to open and edit included file to customize options, in my case, source\include\jcld27win32.inc.
I'm starting to learn Delphi, and I didn't understand whats is it is necessary to do in this file, and didn't find videos showing a manual installation.
Someone who already installed this way could help me?
Manual Installation Although it is not recommended, a manual
installation is possible. You will have to manually configure options
for the library. That is done by modifying an included file. For each
tool you want to install the JCL in, repeat the following steps:
Open and edit included file to customize options: ... For Delphi 10.4 and C++Builder 10.4 Win32: source\include\jcld27win32.inc ...
In the IDE, open and compile package Jcl.dpk (or Jcl.bpk for C++Builder) located in a subdirectory of the "packages" directory
matching your version of the IDE. This package doesn't have to be
installed since it doesn't provide any components.
If you want to install experts, open package JclBaseExpert.dpk and compile it, then you can install all the experts you want (packages
are located in the same directory).

I get a Can't load package error although the BPL is there

This issue is driving me crazy. I'm trying to compile and install The QR Designer from QuickReports 6. I have an issue just with the one package. When I right the package in the IDE > Install the IDE gives me:
Can't load package C:\xe10_3\QRDesign\Win32\Debug\dclqrd_DXE10_3.bpl.
The specified module could not be found.
But the exact file is there.
I've also tried installing it via the menu under Components > Install Packages and then choosing the BPL from there, with the same issue.
I've tried to use Process Monitor as on this post here to find the issue:
Delphi Can't load package the specified module cannot be found
I couldn't fix the issue, but what I did pick up from Process Monitor was that some process was looking for the package here:
Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\21.0\Package Cache\dclqrd_DXE10_3.bpl
That key didn't exists. I tried manually creating the key, but that didn't do a thing.
Any ideas?
UPDATE
Here is the list of packages:
As you can see, dclqrd_DXE10_3 is dependant on two others. Which I already built and installed. I removed its references and re-added them again now, to make sure the references are sound. I guess its like Remy said, the Specified module not found is probably not referring to dclqrd_DXE10_3 although I don't know what other module it could be referring to.
To install a package successfully in IDE, follow the steps:
Open the dpk/dproj/groupproj file in IDE
Build the package(s) for Windows 32-bit platform.
IDE itself is a 32-bit applicaton, so it should match.
Normally, it will build all dependent/required packages
Check if all chain of BPL & DCP files are generated in package Output directory.
It defaults to $(BDSCOMMONDIR)\Bpl & Dcp folders, but can be changed individually for each Package in Settings.
PBL packages are like DLL files. In order to load them, it requires all dependent BPLs.
If you have custom package output paths:
Check if your DCP output path is included in Tools\Options\Language\Delphi\Library Library Path for Windows 32-bit platform
Check if no duplicates of outdated compiled packages in default $(BDSCOMMONDIR)\Bpl & Dcp directories
Add the paths to library source pas files in Tools\Options\Language\Delphi\Library Browsing path or Library path
In some specific cases, if the package requires some extra dll-s like DB Client libraries, check if these dlls are 32-bit and are loadable, like included in %path% environement variable.
Note, some libraries offers package installer tools, that automagically do all mentioned things for you.
Also, there are universal package installer tools for quick working environement setup in one click.
I don't know why this fixed my issue, but it did.
The output directories for the bpl and dcp was set to be $(Platform)\$(Config)
The project files for the different packages exists in the same folder so the above config was supposed to be the debug folder or the release folder. Why only this package was thrown off I still don't know, but since changing the above packages to have a fixed path suddenly I could now install dclqrd_DXE10_3.bpl.
Thank you all for helping.

How to install Spring4D

I have downloaded the latest build of the Delphi Spring Framework. As directed in the readme file, I ran Build.exe and selected my two versions of Delphi (XE5 and Seattle). In neither Delphi installation can I see that a package has been installed nor my library search path modified. What am I missing or is there something else I must do to install and use it?
Thanks in advance for your help.
There are no packages to install in Spring4D because only designtime packages are actually installed (as in they show up in the IDE). Everything the Build.exe does it compile the runtime packages for the selected Delphi versions and add the dcu folder to your library path (if you have checked that in the options).
The registry keys where it looks for the library path is specified in the Build.Settings.Compilers.ini (which are default values that every Delphi installation has).

What project options to use for open source Delphi packages?

I've written some Delphi code I would like to share on GitHub. All code is contained in runtime and designtime packages as required. There are many "Project Options" to set for each project. (Output directories, search paths, compilation options, etc.) I've managed to find some default options that work well for my situation but reading other Q&As here it's clear there are multiple ways of working.
What project options should be used to allow the open source packages to easily be incorporated into individual projects?
I've recently started using NodeJS. The NPM package manager makes it super easy to use third-party packages in a project. Packages are installed with one simple command on the command line. Packages will automatically install any required dependencies.
PS: Feel free to edit this question if you would like to add extra things to consider.
Let's say you have this structure
MyComponent
Packages
DelphiXE7
Package2.dpr
source
bin
Delphi XE7
then set
Search Path
..\..\..\source
Unit output directory
..\..\..\bin\Delphi XE7\$(Platform)\$(Config)
After compilation for all supported platforms and both Release and Debug you will have this structure in the bin directory
MyComponent
Packages
DelphiXE7
Package2.dpr
source
bin
Delphi XE7
Android
Release
Debug
Win32
Release
Debug
Win64
Release
Debug
For installation you have to setup some path inside the IDE.
Environment
MYCOMPONENT => [root path to the files]
Library
Repeat that for all supported platforms
Library Path
$(MYCOMPONENT)\bin\Delphi XE7\$(Platform)\Release
Search Path
$(MYCOMPONENT)\source
Debug-DCU-Path
$(MYCOMPONENT)\bin\Delphi XE7\$(Platform)\Debug
If there are some language related units there is also a place to add (see Library - translated)
This ensures, that you have full debug feature (with Use Debug-DCU option set) and on release you have no debug code in your application.
Just a sidenote on libraries you should not want to install because you only use them in some projects.
Simply use the Optionset combined with a environment variable.
Here my SuperObject.optionset ($(USRLIB) points to a directory, where I collect all common used source code. And $(USRLIB)\ext is the place for all of the external libraries).
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DCC_UnitSearchPath>$(USRLIB)\ext\superobject;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
</PropertyGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType>OptionSet</Borland.ProjectType>
<BorlandProject>
<Delphi.Personality/>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
</Project>
To use the superobject library I simply add the optionset to the project (right mouse click on build configuration) and everything is fine.

Automatic building and installing Delphi components

So, my Delphi component is functional and working, aside few details yet to cover. What I would like is to create a setup (Inno setup) that would automatically install my component into user's Delphi/C++ Builder IDE. I presume I must use delphi command line compiler, but how?
Thank you.
Unfortunately Delphi IDE does not support automated component installation at all. IMO, that is very big problem since component architecture is so important in Delphi.
You can build your package from command line (using MSBuild or DCC) but you cannot install it to IDE. To install your package you should write your own installer that builds you package, copies compiled files and updates Windows registry. Note there is no official documentation how to write such an installer, but you can take Jedi (JVCL) installer code as an example.
There are also 3rd party tools that automate component installation, for example 'lazy builder', that may be interesting to you.
It's not too hard, just messy. You need to compile a BPL for each Delphi version that you want to target and then your installer puts this BPL into a folder of your choosing (often users,public etc). This folder location is then written as a registry key under the relevant Delphi Installed Packages node. Lo when you run Delphi your components appear as if you had used the manual install packages option.

Resources