# Delphi Compile Action.LibraryPath refresh?

**URL:** https://www.finalbuilder.com/forums/t/delphi-compile-action-librarypath-refresh/502
**Category:** Discussion
**Created:** [June 22, 2007, 6:04am UTC](https://www.finalbuilder.com/forums/t/delphi-compile-action-librarypath-refresh/502 "2007-06-22T06:04:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 22, 2007, 6:04am UTC](https://www.finalbuilder.com/forums/t/delphi-compile-action-librarypath-refresh/502/1 "2007-06-22T06:04:17Z")

</div>

Hi guys

In my build script, I have a Delphi Compile action where I need to change the version of Delphi I compile with. Essentially, it's based on a build parameter which indentifies the codeline I'm building.

However, when I change the Action.CompilerVersion property in my BeforeAction script, the Action.LibraryPath does not change in synch which is different from what happens with you change it in the UI. And the Compile action then fails building it's cfg due to not being able to expand either $(DELPHI) or $(BDS) respectively.

Is there a way to force the Delphi action to reload the correct Action.LibraryPath for the appropriate CompilerVersion like it does in the UI?

If not, I'm forced to have an IF block and two Delphi Compiler actions which seems clumsier.

Regards, Paul.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [June 22, 2007, 7:21am UTC](https://www.finalbuilder.com/forums/t/delphi-compile-action-librarypath-refresh/502/2 "2007-06-22T07:21:52Z")

</div>

Hi Paul   
  
 In this case you should have the “Use Global Delphi Library Path” option checked, then it will act as you need.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [July 5, 2007, 4:44am UTC](https://www.finalbuilder.com/forums/t/delphi-compile-action-librarypath-refresh/502/3 "2007-07-05T04:44:23Z")

</div>

|
| |

Vince wrote:

|
| |

| &nbsp; | Hi Paul   
  
 In this case you should have the "Use Global Delphi Library Path" option checked, then it will act as you need. |

Unfortunately, I tried that and it doesn't seem to make any difference. At least not in FinalBuilder 4.

if it's helps to clarify here is the key snippet of BeforeAction code:

&nbsp;

&nbsp;Action.AlwaysUseDelphiLibraryPath = True  
&nbsp;MsgBox(Action.LibraryPath)  
&nbsp;Action.CompilerVersion = 0  
&nbsp;MsgBox(Action.LibraryPath)  
&nbsp;Action.CompilerVersion = BUILDWITH ' 4 = Delphi7, 11 = Delphi 2006  
&nbsp;MsgBox(Action.LibraryPath)  
&nbsp;Action.LibraryPath = Replace(Action.LibraryPath, "..\..\Newlook\", "..\Newlook\")  
&nbsp;Action.AlwaysUseDelphiLibraryPath = False

&nbsp;

Each MsgBox shows the exact same out of date path that the action currently has (albeit shown greyed out due to the option) but the Global library options have been updated and the action never seems to see them.

I'm guessing that FinalBuilder's actual implementation of Action.LibraryPath is that it only gets used for the .cfg if Action.AlwaysUseDelphiLibraryPath is False and is completely ignored otherwise, as opposed to Action.LibraryPath being populated with the global library path if told to and Action.LibraryPath always being placed into the .cfg

&nbsp;

That would explain the behaviour I'm seeing and would normally work just fine _ **unless** _ you're trying to work with the default library path in Action code like I'm trying to do.

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [July 6, 2007, 1:30am UTC](https://www.finalbuilder.com/forums/t/delphi-compile-action-librarypath-refresh/502/4 "2007-07-06T01:30:22Z")

</div>

Hi Paul

You can access&nbsp; the delphi library paths using the options object in script :

dim opt  
  
set opt = GetOptionsObject("Borland Delphi")  
if not (opt is nothing)&nbsp; then  
  
&nbsp;&nbsp;&nbsp; msgbox opt.D2007LibraryPath  
  
end if

Note that code completion only shows up to D2005 however the properties are there for 2006 & 2007 (the xml code completion file needs updating).

HTH

&nbsp;

&nbsp;
