# Delphi $(Platform)\\$(Config) directories

**URL:** https://www.finalbuilder.com/forums/t/delphi-platform-config-directories/2511
**Category:** Discussion
**Created:** [December 13, 2016, 1:13am UTC](https://www.finalbuilder.com/forums/t/delphi-platform-config-directories/2511 "2016-12-13T01:13:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rlove](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/rlove/32/27_2.png) [@rlove](https://www.finalbuilder.com/forums/u/rlove)
#### Post date: [December 13, 2016, 1:13am UTC](https://www.finalbuilder.com/forums/t/delphi-platform-config-directories/2511/1 "2016-12-13T01:13:33Z")

</div>

Using FB 8.0.0.1937  
I have a Delphi Action that is building a 3rd party commercial package. &nbsp; This package has two configurations “Debug” & "Release"  
I am trying to build each of these into my own output directories.  
  
I am loading all the options from the Project file except "Directories"  
I created a variable&nbsp;  
%BUILD\_OUTPUT\_DIR%  
Set it’s default value to:  
%LOCAL\_BUILD\_DIR%%PRODUCT\_NAME%%PRODUCT\_VERSION%$$(Platform)$$(Config)  
Then marked it as a macro.  
  
Then in the action I set “Output directory”, “Unit output directory”, “BPL output directory” and "DCP output directory"  
to %BUILD\_OUTPUT\_DIR%  
  
I run and it builds as expected but the output is in:  
C:\VCL\Output\TRichview\LocalTest$(Platform)$(Config)  
  
I don’t want to have the directories name $(Platform)$(Config) &nbsp;I would rather if directories were expanded and created like this:  
C:\VCL\Output\TRichview\LocalTest\Win32\release\<br\>  
I am missing something to be able to do this?

---

<div class="post-metadata">

### Author: ![rlove](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/rlove/32/27_2.png) [@rlove](https://www.finalbuilder.com/forums/u/rlove)
#### Post date: [December 13, 2016, 10:24am UTC](https://www.finalbuilder.com/forums/t/delphi-platform-config-directories/2511/2 "2016-12-13T10:24:07Z")

</div>

Realized variable that $(PLATFORM) and $(CONFIG) don’t exist in finalbuilder.  
  
So I created them.  
  
Then added this global script  
  
Sub SetConfigPlatform(Action)  
Config = Action.ConfigName  
select case Action.Platform  
&nbsp; case 0 Platform = “Win32”  
&nbsp; case 1 Platform = “Win64”  
&nbsp; case 2 Platform = "OSX"  
end select  
end sub

  

The add the following script to each delphi Action in the OnBeforeAction Script  
  
SetConfigPlatform(Action)

---

<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: [December 13, 2016, 10:51am UTC](https://www.finalbuilder.com/forums/t/delphi-platform-config-directories/2511/3 "2016-12-13T10:51:17Z")

</div>

Hi Robert   
  
 I will look into it, this may be an oversight in the migration to the new variables architecture in FB8. The delphi action does have code to provide those variables but it isn’t being called, need to figure out why.

---

<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: [December 16, 2016, 7:05am UTC](https://www.finalbuilder.com/forums/t/delphi-platform-config-directories/2511/4 "2016-12-16T07:05:34Z")

</div>

This is fixed for the next update (probably early next week), as I suspected, the code was there to handle this, but never got hooked up in FB8.

---

<div class="post-metadata">

### Author: ![metrima](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/metrima/32/138_2.png) [@metrima](https://www.finalbuilder.com/forums/u/metrima)
#### Post date: [December 22, 2016, 10:42am UTC](https://www.finalbuilder.com/forums/t/delphi-platform-config-directories/2511/5 "2016-12-22T10:42:47Z")

</div>

I have a similar issue. When I change the “Platform” property i the property panel (or by script) the paths is not changed. But if I do the platform change in the action dialog, it works correct.
