Add path to Delphi's global library path

Hi,

I know the delphi library path topic has already been discussed a few time, but I can’t seem to find the information I need.

We use FinalBuilder 8 with Delphi Berlin and XE2.

We recently had to make a “temporary” fix in Delphi’s core unit (Data.DB.pas). In order for Delphi to take our unit instead of theirs, we need to add our unit’s path into the library path as the first element of the list.

Currently we are using the “Use global delphi library path” option in all of our projects. All projects are built calling the same script in their BeforeAction. Is it possible to add a path to the library path list in the BeforeAction VBScript ? I tried using Action.LibraryPath, but, before adding our path to it, I show its content using MsgBox(Action.LibraryPath)  and it returns empty. How can I retrieve the global library path (compiler specific) and modify its content ? 

Ideally I would only add that 1 path, and not type in the entire list within the script. I could possibly read the registry to retrieve the list, but I hoping for a simpler solution.

Thank you

I found my solution.

I wasn’t using the correct object GetOptionsObject(“Borland Delphi”) thus did not have access to D10BerlinLibraryPathWin64

Now using the correct object
dim opt
set opt = GetOptionsObject(“Embarcadero Delphi”)
opt.D10BerlinLibraryPathWin64 = “%CODE_FOLDER%\HotFix;” & opt.D10BerlinLibraryPathWin64

Still having problems…

I am able to modify the library path as mentioned above, however, the library path is not taken into account. The fix found in my local copy of Data.DB is not applied. If I add the path in delphi and build a release with final builder than the correct library path is used, the fix is there.

Why? what am I missing ?

I have tried:

1) In BeforeAction, modify the the library path with and without the “Use global delphi library path” option.

dim opt
set opt = GetOptionsObject(“Embarcadero Delphi”)
opt.D10BerlinLibraryPathWin64 = “%CODE_FOLDER%\HotFix;” & opt.D10BerlinLibraryPathWin64

2) In BeforeAction, modify Action.LibraryPath with and without the “Use global delphi library path” option.
3) Both 1 and 3 at the same time

nothing works, but adding the path in borland delphi directly.

Hi

There is a much simpler way to deal with this, by adding the hofix path to the Project Search Path. The search path is added to the front of path when the cfg file is generated for the compiler. You can do this either by :

1) Setting the search path for the Project in the Delphi IDE, and telling FinalBuilder to use the search path from the project (make sure you select the correct configuration)
2) Setting the search path directly in FinalBuilder.

In scripting, you can set it via Action.SearchPath