Solved

Where delphi find BPL files?

Posted on 2006-07-14
10
797 Views
Last Modified: 2010-04-05
Hi,


Where deplhi find BPL files (with runtime packages) ? Only looking "path" (environment variable) ?? Do not exists another way ?

I want create one subfolder called "Lib" for store all BPL files. This folder will be distribuited with my .EXE file.

Tanks.

Antenor
0
Comment
Question by:antenor
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 17107882
that is partially correct. delphi will search for a bpl following the windows standard "algorithm" that can be found in msdn and another few places.
so what you will have to do is add the extractfilepath(application.exename)+'Lib' to the system path
0
 

Author Comment

by:antenor
ID: 17107918
ok, but i use "static" runtime package...

For dynamic load, it is OK!
0
 
LVL 28

Expert Comment

by:2266180
ID: 17108016
for dynamic load you specify teh path so there is no need to bother with this issue. the issue is indeed at static linking and that is why the lib dir must be in the path as actually it's not delphi nor your app that is searching for the bpl's but the system
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 28

Expert Comment

by:2266180
ID: 17108020
the reason I said: extractfilepath(application.exename)+'Lib'  is to state that you need to add full path not relativ path top the system path ;)
0
 
LVL 7

Accepted Solution

by:
kfoster11 earned 350 total points
ID: 17108110
For static the os will load the packages before your application starts running so a few options would be to;
1) create a batch file that adds to the path and then launches the application
2) create a small front end application that sets up the environment and then executes the main application as a child process
3) add the path to the users environment settings so that windows automatically creates the environment for you.
4) place the bpls in the same folder as the exe.
5) place the bpls in the windows\system32 folder (this is where they belong according to Microsoft :)  

good luck
0
 

Author Comment

by:antenor
ID: 17108229
So, it wants to say that, in the case of static packages, does not have another alternative that:

-  set the PATH (environment variable) to my "lib" folder, or;
-  place BPLs files in the Windows\system, or
-  place BPLs files in the same folder as the exe.

is this ok?


0
 
LVL 7

Expert Comment

by:kfoster11
ID: 17108529
basically, static dlls (or bpls) are loaded prior to any code in the application being processed.  So the OS has to be able to find the BPL's at the time the application is loaded into memory, so you have to have the BPL's in the path prior to executing the application.

when searching for a file, windows first looks in the applications folder then the windows folder then the system folders (system,system32) then it goes through the path,

I would personally add the extractfilepath(application.exename)+'Lib' to the all users environment in my installation program(I couldn't locate the code to do this, if you want it I will look through my archives).  but basically the easiest thing to do would be to place the BPL's into the applications folder (this would be the first place the OS looks).
0
 

Author Comment

by:antenor
ID: 17108701
The problem is that I have my application in many customers ( and many computers ).

If it was possible to set this -  extractfilepath(application.exename)+'Lib' to path of the user environment) - inside of application (on load), would be solved the problem.

0
 
LVL 28

Assisted Solution

by:2266180
2266180 earned 150 total points
ID: 17109065
unfortunatly that is not possible. and I can't think of any workaround for the application except dynamically loading them
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 17112003
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question