# Specifying location of dcc32.exe in Project Variables

**URL:** https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097
**Category:** Discussion
**Tags:** delphi
**Created:** [August 12, 2021, 6:42am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097 "2021-08-12T06:42:24Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![malcolm](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/malcolm/32/2174_2.png) [@malcolm](https://www.finalbuilder.com/forums/u/malcolm)
#### Post date: [August 12, 2021, 6:42am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/1 "2021-08-12T06:42:25Z")

</div>

I am replacing an ancient Makefile with Finalbuilder. One of the things I need to do is compile a project with multiple different versions of Delphi. I have all the bin and lib directories for the various compilers setup under a common root, rather like this post [The Delphi Geek: Setting Up a Parallel Build System](https://www.thedelphigeek.com/2015/08/setting-up-parallel-build-system.html). Note, like that post, I don’t have the entire IDEs installed, just the bits necessary to use the command line compilers.

After reading this thread, [Change path to dcc32.exe when using a delphi build action](https://www.finalbuilder.com/forums/t/change-path-to-dcc32-exe-when-using-a-delphi-build-action/2080), I setup Project variables for the different dcc32 and brcc32 executables, however Finalbuilder doesn’t seem to be using them. It continually complains about not being able to find dcc32:

“Delphi compiler not found. Please make sure you have specified the correct Delphi compiler version”

Here are the two variables I have setup:  
DELPHI7 Z:\compilers\delphi\7.0\Bin\dcc32.exe  
DELPHI7\_BRCC32 Z:\compilers\delphi\7.0\Bin\brcc32.exe

So it feels like I’m missing a step. Anyone done this before?

Cheers  
Malcolm

---

<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: [August 12, 2021, 6:57am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/2 "2021-08-12T06:57:27Z")

</div>

Hey Mal

FinalBuilder looks in the registry for the delphi install locations. The registry keys have changed over the years, so it’s easier to explain with code 🙂

```delphi
  TCompilerVersionToBDSVersionString : array[TCompilerVersion] of string = (
    '3.0', '4.0', '5.0', '6.0', '7.0', //d3-7
    '','','','','',//bcb 3-7 //not used
    '3.0', '4.0', '5.0', '6.0', '7.0', //2005-2010
    '8.0', '9.0', '10.0', '11.0', '12.0', '14.0', '15.0', '16.0', //XE - XE8
    '17.0', '18.0', '19.0', '20.0', '21.0', '22.0' //10 - 11
  );

..
  case compilerVersion of
    TCompilerVersion.Delphi3,
    TCompilerVersion.Delphi4,
    TCompilerVersion.Delphi5,
    TCompilerVersion.Delphi6,
    TCompilerVersion.Delphi7: sKey := 'Software\Borland\Delphi\%s';
    TCompilerVersion.Delphi2005,
    TCompilerVersion.Delphi2006,
    TCompilerVersion.Delphi2007 : sKey := 'Software\Borland\BDS\%s';
    TCompilerVersion.Delphi2009,
    TCompilerVersion.Delphi2010: sKey := 'Software\CodeGear\BDS\%s';
  else
    sKey := 'Software\Embarcadero\BDS\%s';
  end;
 sKey := Format(sKey,[TCompilerVersionToBDSVersionString[compilerVersion]]);
 if reg.OpenKey(sKey,False) then
  begin
    try
      sTmp := reg.ReadString('RootDir');
...

```

It looks for the `RootDir` value at those keys.

You could add the variable overrides by creating project variables but since I’m guessing you are going to be compiling for multiple versions (assuming the project is what I think it is) that would be a pain to do for every project. If you run FB on a machine that has delphi installed you will see it creates a bunch of variables for each installed version of delphi. I have 13 versions of installed on my machine and this is just some of the variables

 ![image](https://www.finalbuilder.com/forums/uploads/default/original/2X/5/54df6db75ec60b64209dda274e9c45eed660827c.png)

So the simplest option is to create the required registry keys and let FinalBuilder do the work for you.

---

<div class="post-metadata">

### Author: ![malcolm](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/malcolm/32/2174_2.png) [@malcolm](https://www.finalbuilder.com/forums/u/malcolm)
#### Post date: [August 12, 2021, 6:57am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/3 "2021-08-12T06:57:32Z")

</div>

Just noticed this, in case it helps:

Even though I’ve selected Delphi 7 in the action, in the Message View it seems to not know that:

Compiler selected is :  
Delphi compiler not found. Please make sure you have specified the correct Delphi compiler version

---

<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: [August 12, 2021, 6:59am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/4 "2021-08-12T06:59:06Z")

</div>

That will be because the variables are not present - so it has no way of knowing about delphi 7.

---

<div class="post-metadata">

### Author: ![malcolm](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/malcolm/32/2174_2.png) [@malcolm](https://www.finalbuilder.com/forums/u/malcolm)
#### Post date: [August 12, 2021, 7:01am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/5 "2021-08-12T07:01:38Z")

</div>

Thanks mate, our messages crossed. I’ll give that a go.

And I think you’re assuming correctly about what project it is. A hierarchy of 26 Makefiles, incredibly brittle. I have them all working, but if I look sideways at them they break. Throw in the fact that it is running under cygwin and if I had hair I’d be pulling it out.

I’ve decided that as I need to make changes to each one, I’ll convert it over to finalbuilder.

Cheers

---

<div class="post-metadata">

### Author: ![malcolm](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/malcolm/32/2174_2.png) [@malcolm](https://www.finalbuilder.com/forums/u/malcolm)
#### Post date: [August 12, 2021, 7:27am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/6 "2021-08-12T07:27:04Z")

</div>

Progress, but not there yet. I created the registry entry for one of them:

 ![Screen Shot 2021-08-12 at 5.16.12 pm](https://www.finalbuilder.com/forums/uploads/default/original/2X/7/7a0c34e880bc0642424c32b0af356f3dc9c6c33e.png)

I then deleted the Project Variables I had previously created, then restarted FB.

It now shows in the Messages that it knows I’m using Delphi 7, however it still fails with the same error.

Where did you get that list of all your variables in the last screenshot?

Update: I found that list of variables. No Delphi 7 ones in there. Do I need to force a refresh somehow?

Anyway, I’m about to knock off so don’t worry about this right now.

---

<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: [August 12, 2021, 7:29am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/7 "2021-08-12T07:29:51Z")

</div>

That list is on the projects view in FinalBuilder (view menu, projects).

I think you just need to take the `Bin` of the path… the RootDir is just the root of the installation dir.

You will need to restart FinalBuilder to pick up the change BTW.

---

<div class="post-metadata">

### Author: ![malcolm](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/malcolm/32/2174_2.png) [@malcolm](https://www.finalbuilder.com/forums/u/malcolm)
#### Post date: [August 12, 2021, 7:35am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/8 "2021-08-12T07:35:34Z")

</div>

> [@Vincent](#):
>
> I think you just need to take the `Bin` of the path… the RootDir is just the root of the installation dir.

Well spotted. If I change that I still don’t get the Delphi7 and Delphi7\_BRCC32 variables in my list like you do though.

Let me try another one

---

<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: [August 12, 2021, 7:43am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/9 "2021-08-12T07:43:46Z")

</div>

Makes sure it’s under

`Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node`

since it’s a 32bit process.

---

<div class="post-metadata">

### Author: ![malcolm](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/malcolm/32/2174_2.png) [@malcolm](https://www.finalbuilder.com/forums/u/malcolm)
#### Post date: [August 12, 2021, 7:47am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/10 "2021-08-12T07:47:36Z")

</div>

That was it mate, champion!

Thanks a bunch. Oh, and sorry about the lockdown weekend ☹

---

<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: [August 12, 2021, 7:57am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/11 "2021-08-12T07:57:11Z")

</div>

Great, now you just need to add the keys for the 20 other versions of delphi 🙂

As for the lockdown… not your fault - I (and probably half the country) blame Gladys for not locking down Sydney earlier!

I work from home already so not a big deal work wise, does kill off soccer this weekend - I coach a womens state league side - and we had a game against the team below us on the ladder… so points were up for grabs ☹. Oh well, some time for some other projects around the house instead - I have new mitre saw to test out!

---

<div class="post-metadata">

### Author: ![malcolm](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/malcolm/32/2174_2.png) [@malcolm](https://www.finalbuilder.com/forums/u/malcolm)
#### Post date: [August 12, 2021, 8:02am UTC](https://www.finalbuilder.com/forums/t/specifying-location-of-dcc32-exe-in-project-variables/7097/12 "2021-08-12T08:02:46Z")

</div>

> [@Vincent](#):
>
> Great, now you just need to add the keys for the 20 other versions of delphi

That’s nothing compared to trying to do it from these bloody makefiles. Even just escaping the strings is doing my head in. One way for cygwin processed strings, another way for app processed strings. This is like a walk in the park compared.
