Solved

Where delphi find BPL files?

Posted on 2006-07-14
10
820 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

729 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