anchor.diff:  (*
     Name:             main
     Copyright:        Copyright (C) SIL International.
  -  Documentation:    
  -  Description:      
  +  Documentation:
  +  Description:
     Create Date:      1 Aug 2006
   
     Modified Date:    25 Oct 2016
     Authors:          mcdurdin
  -  Related Files:    
  -  Dependencies:     
  -
  -  Bugs:             
  -  Todo:             
  -  Notes:            
  +  Related Files:
  +  Dependencies:
  +
  +  Bugs:
  +  Todo:
  +  Notes:
     History:          01 Aug 2006 - mcdurdin - Initial version
                       02 Aug 2006 - mcdurdin - Timeout when Beta expires
                       04 Dec 2006 - mcdurdin - Block Keyman loading if KM5/6 running
  
positive.code:   Vcl.Dialogs,
    Vcl.Forms,
    Winapi.Windows,
    System.Win.Registry,
    System.SysUtils,
  
    GetOsVersion,
    Keyman.System.Security,
  
negative.code: procedure InitialiseRegistrySecurity;
  var
    r: TRegistry;
  
    procedure ProcessKey(const root: string);
    var
      s: string;
      str: TStringList;
    begin
      if r.OpenKey('\' + root, True) then
      begin
        str := TStringList.Create;
        try
          r.GetKeyNames(str);
          GrantPermissionToAllApplicationPackages(r.CurrentKey, KEY_READ);
          for s in str do
            ProcessKey(root + '\' + s);
        finally
          str.Free;
        end;
      end;
    end;
  
  begin
    r := TRegistry.Create;
    try
      ProcessKey(SRegKey_KeymanRoot_CU);
    finally
      r.Free;
    end;
  