Specifying location of dcc32.exe in Project Variables

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. 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, 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

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 :slight_smile:

  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

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

1 Like

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

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

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

1 Like

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

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.

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.

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

Makes sure it’s under

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node

since it’s a 32bit process.

1 Like

That was it mate, champion!

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

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

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 :frowning_face:. Oh well, some time for some other projects around the house instead - I have new mitre saw to test out!

1 Like

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.