Just a short post to share something I learned the hard way today when moving a FinalBuilder installation from a 32-bit Windows server to a shiny new 64-bit Windows 2008 server on our even shinier new HyperV platform: The 64-bit registry can catch you out.
The registry on 64-bit Windows (as probably everybody but me knows) contains both 32-bit and 64-bit keys. But the 32-bit keys are effectively redirected for keys in the Software branches:
On a 64-bit Windows system if you explore these keys using regedit you will find a sub-key:
When a 32-bit process access the HKLM\Software or HKCU\Software keys it is in fact accessing the Wow6432Node subkey ! This is of course all for very good reasons.
Why is this important for FinalBuilder and Delphi ?
Well, FinalBuilder detects the presence of a Delphi version on your build machine by the presence of specific keys in the registry for each individual version of Delphi. For Delphi 2006 for example, FinalBuilder is looking for a value called:
This key would normally be created when you install Delphi, but FinalBuilder doesn’t require that your Delphi installation be a fully and completely installed instance of Delphi. As long as this RootDir value is present and points to a folder containing the relevant Delphi files (and as long as certain other registry keys are available in the absence of specific configuration in FinalBuilder), this is enough for FinalBuilder to recognise the presence of a particular Delphi version and invoke it’s command line compiler.
Which is great, because this means that “installing” Delphi on our build machine can be achieved by merely checking out the “tools” folder of our SVN repository. This folder includes an image of a Delphi installation (bin, source etc) and a pair of .reg files containing registry keys to be imported.
Except that when those .reg files are imported on a 64-bit version of Windows, having been exported from a 32-bit version, the keys are imported to the wrong place and FinalBuilder (being a 32-bit process) won’t find those imported keys !
This isn’t a problem if you are actually installing Delphi on the machine where FinalBuilder is located because both Delphi and FinalBuilder are 32-bit processes. The Delphi installer will create the necessary keys in the 32-bit tree from the outset.
The solution if – like us – you are not actually installing Delphi is of course very simple once you know what the problem is. We now have 32-bit and 64-bit versions of these .reg files, where the 64-bit version includes the Wow6432Node folder in the key paths.