title: How to set value of Registry Key
body: <p>I am having one Delphi XE2 project to write something in registry key. So I have defined the following codes :</p>
  
  <pre><code>procedure TMainForm.BitBtn01Click(Sender: TObject);
  var
    RegistryEntry: TRegistry;
  begin
    RegistryEntry:= TRegistry.Create(KEY_READ);
    RegistryEntry.RootKey:= HKEY_LOCAL_MACHINE;
    if (not RegistryEntry.KeyExists('Software\MyCompanyName\MyName\')) then
    begin
      RegistryEntry.Access:= KEY_WRITE;
      RegistryEntry.OpenKey('Software\MyCompanyName\MyName\',True);
    end;
    RegistryEntry.CloseKey();
    RegistryEntry.Free;
  end;
  </code></pre>
  
  <p>If any string addition I have defined the following codes :</p>
  
  <pre><code>if (not RegistryEntry.KeyExists('Licenced To')) then
    begin
      RegistryEntry.WriteString('Licenced To', 'MySurname MyFirstName');
    end;
  </code></pre>
  
  <p><strong>My requirements :</strong></p>
  
  <p><strong>01. Setting the default value as shown :<img src="https://i.stack.imgur.com/j3UQ6.jpg" alt="Picture"></strong></p>
  
  <p><strong>02. In Win64 OS the node is created under HKEY_LOCAL_MACHINE\WOWSys64\Software but not under HKEY_LOCAL_MACHINE\Software.</strong></p>