0

I have a group project:

  • PkagDemmo.exe(main application)
  • AppAddin.bpl(load/unload bpl and create Form utilities)
  • PkgData.bpl(DataModeule unit for Data access utilities)
  • Pakage1.bpl(Form1 bpl and show data)
  • Pakage2.bpl(Form2 bpl and show data) PakDemo.exe Project Options:
  • Packages/Runtime Packages/ Link with runtime Package = true
  • Packages/Runtime Packages/ Runtime packages = true

On my developed PC, the application runs well,but moving those 5 files to my notebook,run the PkageDemo.exe will rise the Error: can not found: FireDACCommonDriver270.Bpl, FireDACComnon270.Bpl,FireDACCommonODBC270.Bpl,vclFireDac270.Bpl......... those are PkgData.bpl DataMoudles uses FireDacXXXX units, DB units require dynamic bpls. I copy those bpls to my notebook, but it still shows an Error. Why application can not find those FireDacxxx.bpl, and how to solve this problem? //Delphi 10.4.2 Win10

Mitchell Hu
  • 105
  • 1
  • 6

1 Answers1

1

Standart rule of finding files by application:

  1. It's try to find in current work folder (if you use link it's field "work directory" of link, if you run by doubleclicking in explorer - current folder)
  2. It's try to find file by parsing string in "Path" enviroment variable. It's take folders one by one, splited by ";" symbol.

If application does not find file by those rules - you will get error message. So to solve your problem you can - place all files in same folder or modify "path" variable to add folders with all your bpls or use absolute path to files (if you load it manualy in runtime).

It's works on your DeveloperPC becouse Delphi add folders with runtime bpls in "path" variable.

Added later:

About "path" - It's a system environment variable, so it's depend from version of Windows how to open it. If you use Widnows 10 or 11 just go to settings and type "enviroment" in "find box" - windows will show show editing window. But it's will not help until you find all necessary bpls.

Main problem that you must put not only bpls that your application and your bpls using directly, but also bpls that FireDac bpls is using.

Easiest way to find them all - use some program that can find dll/exe/pbl dependancies. I use "File info plugin" for TotalCommander, but you can google some other programs for same action.

Other way much longer, but don't need any additinal programs. You try to run your application, see error message like "The code execution cannot proceed because KComponents.bpl was not found. ....". Then find this "KComponents.bpl" on Develop PC (first look at something like "c:\Program Files (x86)\Embarcadero\Studio\21.0\Redist\win32"), copy to notebook at same folder with EXE file of your application and try to run it again. You will see next BPL that is missing. And so on, so on.

Here is a dependency tree for all BPLs that you write in question:

FireDACCommonODBC270.bpl
    rtl270.bpl
    dbrtl270.bpl
        rtl270.bpl - duplicate
    FireDACCommon270.bpl
        xmlrtl270.bpl
        rtl270.bpl - duplicate
        dbrtl270.bpl - duplicate
    FireDACCommonDriver270.bpl
        rtl270.bpl - duplicate
        dbrtl270.bpl - duplicate
        FireDACCommon270.bpl - duplicate
        
vclFireDAC270.bpl
    rtl270.bpl
    dbrtl270.bpl
    vclwinx270.bpl
        vcl270.bpl
            rtl270.bpl - duplicate
        vclimg.270.bpl
            rtl270.bpl - duplicate
            vcl270.bpl - duplicate
        rtl270.bpl - duplicate
        bindengine270.bpl
            rtl270.bpl - duplicate
    FireDACCommon270.bpl - duplicate
    FireDAC270.bpl
        rtl270.bpl - duplicate
        dbrtl270.bpl - duplicate
        FireDACCommonDriver270.bpl - duplicate
        FireDACCommon270.bpl - duplicate
    vclx270.bpl
        rtl270.bpl - duplicate
        vcl270.bpl - duplicate
    vcldb270.bpl
        rtl270.bpl - duplicate
        vcl270.bpl - duplicate
        vclwinx270.bpl - duplicate
        dbrtl270.bpl - duplicate
        vclwinx270.bpl - duplicate
    vcl270.bpl - duplicate
  • I did add all FireDacXXX.bpls into the same folder with PkagDemmo.exe, PkgData.bpl....., But still, gets errors. About modifying "path" variable, where can find it? have no idea about it. Thanks – Mitchell Hu Nov 17 '22 at 10:17
  • @MitchellHu comment was too long, so i add it to answer. – Oleksandr Morozevych Nov 17 '22 at 14:38
  • Oleksandr Morozevych thanks for your detail answer [Link](https://www.dropbox.com/s/q2eopvrrpjn7dp3/bplerror_samefolder.PNG?dl=0) link picture shows , all FireDacXXX.bpls are placed in the same folder with Exe file, but not thing changed. Why PkgData.bpl can not search those FileDacXXX.bpls even they are in the same folder? – Mitchell Hu Nov 18 '22 at 02:08
  • 1
    Oleksandr Morozevyh according to your detailed answer and my bad luck test. I think maybe need more bpls that are not shown in the Error message. I copy all bpls in C:\Program Files (x86)\Embarcadero\Studio\21.0\bin int to the Notebook folder. Finally, It works fine. So, The last action is to delete those none useful bpls ........... Thank a lot!!! – Mitchell Hu Nov 18 '22 at 04:16