Solved

Where delphi find BPL files?

Posted on 2006-07-14
10
803 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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