title: Add registry key using function in innosetup
body: <p>How can i add a registry key in innosetup with a value from a function. I want to set the
  value of IsServer in registry as the return value of InstallAsServer</p>
  
  <pre><code>[Code]
  [Registry]
  Root: HKLM; Subkey: "Software\company\product\Settings"; ValueType: string; ValueName: "IsServer"; ValueData: {code:InstallAsServer}
  
  var
    Page: TInputOptionWizardPage;
    IsServer: Boolean;
  procedure InitializeWizard;
   begin
    Page := CreateInputOptionPage(wpWelcome,
    'Install Type', 'Select Install Type',
    'Please select Installation type; If Server click Server else Client',
    True, False);
  
    // Add items
    Page.Add('Install as Server');
    Page.Add('Install as Client');
  
    // Set initial values (optional)
    Page.Values[0] := True;
    Page.Values[1] := False;
    IsServer := Page.Values[0];
  end;
  
  function InstallAsServer(emppararm: string): string; //emppararm not used just for syntax
  begin
    if (IsServer=False) then
      begin
        result:= '0';
      end
    else
     begin
      result:= '1';
     end
  
  end;
  </code></pre>
  
  <p>But i always get the value set as 1 even if i select server or client in the page</p>