1
votes

Using Embarcadero RAD Studio XE7, I wrote a runtime package containing a VCL component (it's a TGraphic descendent). Now I want to distribute this component, but only the compiled package without his source code. I cannot include it in the distribution because I wrote this package for a company that want to sell it and keep the control on his sources, so distributing the source code isn't an alternative in this case.

The component package depends on 2 other packages I also wrote. All of these packages are runtime, however a graphic filter is registered. After the package is installed, this filter allows me to open a new kind of image file from several native VCL components like TImage on my development computer. This behavior is very important and I want to keep it on the target IDEs.

Ideally I want my package to be installed on all RAD Studio platforms between XE and 10.2 Berlin. However I recently tried to compile my package in release on my devel computer and deploy it manually on another computer installed with RAD Studio XE4. The result was unconvincing:

  • Trying to install the .bpl file using the Component->Install packages... failed with a "The specified module could not be found" error. When opening the .bpl file with the Dependency Walker tool, I noticed that several dependencies like RTL210.bpl were missing
  • I also read somewhere that only design time package may be installed this way, it is exact?
  • Putting all the files (.bpl, .lib, .hpp, ...) of one of my package manually in the XE4 common dirs, I was able to compile a test project successfully. However several functions in my package were unavailable (resulting to an unresolved external when trying to use them)

Although I have several past experience about software and package distribution, I must confess that I have absolutely no idea about how to build a such package for deployment. In all my past scenarios I always distributed the package projects and source codes, and let the user install them on their own IDE.

I searched information about that in the past days but I found nothing. So if somebody can explain how to achieve a such package, or can point me to a document or website describing the process, or eventually give the name of a tool that can do the job, I would be very grateful to him.

Regards

1
You cannot deploy a package compiled with XE7 into a XE4 IDE. You have to deploy a separate package for each IDE compiled with that specific Delphi version. F.i. the XE4 package must be compiled with XE4 which will make it dependent on rtl180.bpl.Uwe Raabe
Why I was downvoted?Jean-Milost Reymond
I don't know. Voting is completely anonymous here.Uwe Raabe

1 Answers

2
votes

If you don't want to to distribute the source files, you then need to provide the .dcu and bpl files. As Uwe says, you need different packages for each Delphi distribution.

What I have done in the past is to create an installer which builds and registers the packages. You can find the full description here:

http://www.kouraklis.com/2016/10/build-and-install-packages-in-delphi-ide-using-innosetup/

I think you can modify the script to skip the call to MSBuild.

Hope this helps.