{"id":725,"date":"2011-08-02T10:40:18","date_gmt":"2011-08-01T22:40:18","guid":{"rendered":"https:\/\/www.deltics.co.nz\/blog\/?p=725"},"modified":"2011-08-02T10:40:18","modified_gmt":"2011-08-01T22:40:18","slug":"finalbuilder-and-delphi-64-bit-registry-gotcha","status":"publish","type":"post","link":"https:\/\/www.deltics.co.nz\/blog\/posts\/725\/","title":{"rendered":"FinalBuilder and Delphi: 64-Bit Registry Gotcha"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\"> 2<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span><p>Just a short post to share something I learned the hard way today when moving a <strong>FinalBuilder<\/strong> installation from a <strong>32-bit Windows<\/strong> server to a shiny new <strong>64-bit Windows 2008<\/strong> server on our even shinier new <strong>HyperV<\/strong> platform: \u00a0The 64-bit registry can catch you out.<\/p>\n<p><!--more-->The registry on 64-bit Windows (as probably everybody but me knows) contains both 32-bit and 64-bit keys. \u00a0But the 32-bit keys are effectively redirected for keys in the <strong>Software<\/strong> branches:<\/p>\n<ul>\n<li>HKEY_LOCAL_MACHINE\\Software<\/li>\n<li>HKEY_CURRENT_USER\\Software<\/li>\n<\/ul>\n<p>On a 64-bit Windows system if you explore these keys using <strong>regedit<\/strong> you will find a sub-key:<\/p>\n<ul>\n<li>HKEY_LOCAL_MACHINE\\Software\\<strong>Wow6432Node<\/strong><\/li>\n<li>HKEY_CURRENT_USER\\Software\\<strong>Wow6432Node<\/strong><\/li>\n<\/ul>\n<p>When a 32-bit process access the <em>HKLM\\Software<\/em> or <em>HKCU\\Software<\/em> keys it is in fact accessing the <span style=\"text-decoration: underline;\">Wow6432Node<\/span> subkey ! \u00a0This is of course all for <a href=\"http:\/\/support.microsoft.com\/kb\/305097\" target=\"_blank\">very good reasons<\/a>.<\/p>\n<p>Why is this important for <strong>FinalBuilder<\/strong> and <strong>Delphi<\/strong> ?<\/p>\n<p>Well, <strong>FinalBuilder<\/strong> detects the presence of a <strong>Delphi<\/strong> version on your build machine by the presence of specific keys in the registry for each individual version of <strong>Delphi<\/strong>. \u00a0For <strong>Delphi 2006<\/strong> for example,\u00a0<strong>FinalBuilder<\/strong> is looking for a value called:<\/p>\n<ul>\n<li>HKEY_LOCAL_MACHINE\\Software\\<strong>Borland\\BDS\\4.0\\RootDir<\/strong><\/li>\n<\/ul>\n<p>This key would normally be created when you install <strong>Delphi<\/strong>, but\u00a0<strong>FinalBuilder<\/strong> doesn&#8217;t require that your <strong>Delphi<\/strong> installation be a fully and completely installed instance of <strong>Delphi.<\/strong> As long as this <strong>RootDir<\/strong> value is present and points to a folder containing the relevant <strong>Delphi<\/strong> files (and as long as certain other registry keys are available in the absence of specific configuration in <strong>FinalBuilder<\/strong>), this is enough for <strong>FinalBuilder<\/strong> to recognise the presence of a particular <strong>Delphi<\/strong> version and invoke it&#8217;s command line compiler.<\/p>\n<p>Which is great, because this means that &#8220;installing&#8221; <strong>Delphi<\/strong> on our build machine can be achieved by merely checking out the &#8220;tools&#8221; folder of our SVN repository. \u00a0This folder includes an image of a <strong>Delphi<\/strong> installation (bin, source etc) and a pair of <strong>.reg<\/strong> files containing registry keys to be imported.<\/p>\n<p>Except that when those <strong>.reg<\/strong> files are imported on a 64-bit version of <strong>Windows<\/strong>, having been exported from a 32-bit version, the keys are imported to the wrong place and <strong>FinalBuilder<\/strong> (being a 32-bit process) won&#8217;t find those imported keys !<\/p>\n<p>This isn&#8217;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. \u00a0The Delphi installer will create the necessary keys in the 32-bit tree from the outset.<\/p>\n<p>The solution if &#8211; like us &#8211; you are not actually installing Delphi is of course very simple once you know what the problem is. \u00a0We now have 32-bit and 64-bit versions of these <strong>.reg<\/strong> files, where the 64-bit version includes the <strong>Wow6432Node<\/strong> folder in the key paths.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\"> 2<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span>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: \u00a0The 64-bit registry can catch you out.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4],"tags":[24,292,134],"class_list":["post-725","post","type-post","status-publish","format-standard","hentry","category-delphi","tag-64-bit","tag-delphi","tag-finalbuilder"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1TKYv-bH","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/comments?post=725"}],"version-history":[{"count":5,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/725\/revisions"}],"predecessor-version":[{"id":730,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/725\/revisions\/730"}],"wp:attachment":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}