# Switch FB files between XE4 and XE2 compile actions

**URL:** https://www.finalbuilder.com/forums/t/switch-fb-files-between-xe4-and-xe2-compile-actions/2175
**Category:** Discussion
**Created:** [July 4, 2013, 12:17pm UTC](https://www.finalbuilder.com/forums/t/switch-fb-files-between-xe4-and-xe2-compile-actions/2175 "2013-07-04T12:17:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bernhard.lippmann](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/b/3be4f8/32.png) [@bernhard.lippmann](https://www.finalbuilder.com/forums/u/bernhard.lippmann)
#### Post date: [July 4, 2013, 12:17pm UTC](https://www.finalbuilder.com/forums/t/switch-fb-files-between-xe4-and-xe2-compile-actions/2175/1 "2013-07-04T12:17:46Z")

</div>

in our software development team we use DELPHI XE2 and Final Builder EMBA edition as a main tool for building our complex software projects.

My role as a project owner&nbsp; is to make sure the upgrade path of our project to the next Delphi compiler version, therefore &nbsp;I#m using Delphi XE2 and XE4 as well as the FB full edition.

I want to build&nbsp; the project on a dedicated test computer using XE 4 compile option and FB full edition using&nbsp;&nbsp;one FB script / project file &nbsp; which should be used on all other computers in our team with XE2&nbsp; compile option.

&nbsp;

How to make a fast switch of the Delphi compile action in all steps ?&nbsp; Manual editiong of the properties is to time consuming&nbsp; and 2 scripts is also no good solution as we have to maintain both files ....

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![ede.colli01](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/e/d26b3c/32.png) [@ede.colli01](https://www.finalbuilder.com/forums/u/ede.colli01)
#### Post date: [July 4, 2013, 10:00am UTC](https://www.finalbuilder.com/forums/t/switch-fb-files-between-xe4-and-xe2-compile-actions/2175/2 "2013-07-04T10:00:37Z")

</div>

Hi Bernard   
  
 I have the same situation here, and I solve this using a “Read Registry Value” action and attribute his value to a variable.   
 This way I can compile Projects with XE2 and XE4 at the same FB project.   
  
 Regards

---

<div class="post-metadata">

### Author: ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)
#### Post date: [July 5, 2013, 2:17am UTC](https://www.finalbuilder.com/forums/t/switch-fb-files-between-xe4-and-xe2-compile-actions/2175/3 "2013-07-05T02:17:00Z")

</div>

Another option is to alter the properties of the action in the BeforeAction script on the Build Delphi action. This script passes the action object, on which there is a CompilerVersion. This is an integer representation of the Delphi Compiler. From the help;   
  
 property CompilerVersion : integer; // D3 = 0, D4 = 1, D5 = 2, D6 = 3, D7 = 4, D2005 = 10, D2006 = 11, D2007 = 12   
  
 This means the following javascript in the BeforeAction would do what you require;   
  
 Action.CompilerVersion = FBVariables.DelphiBuildVersion;   
  
 “FBVariables.DelphiBuildVersion;” is a reference to an integer variable in the FinalBuilder project. EX2 is 16 and EX4 is 18.

---

<div class="post-metadata">

### Author: ![michael](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.finalbuilder.com/forums/u/michael)
#### Post date: [September 16, 2013, 1:10am UTC](https://www.finalbuilder.com/forums/t/switch-fb-files-between-xe4-and-xe2-compile-actions/2175/4 "2013-09-16T01:10:25Z")

</div>

Hi,   
 I have the same problem like Bernhard. Do you mean i have to create a new Action Package?   
 if i want to run the project on a PC with Delphi xe2, FBVariables.DelphiBuildVersion will be referenced to an integer 16?   
  
 Maybe you can describe your approach more detailed.   
  
 Regards   
 Michael

---

<div class="post-metadata">

### Author: ![michael](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.finalbuilder.com/forums/u/michael)
#### Post date: [September 16, 2013, 3:49am UTC](https://www.finalbuilder.com/forums/t/switch-fb-files-between-xe4-and-xe2-compile-actions/2175/5 "2013-09-16T03:49:26Z")

</div>

problem solved
