anchor.diff:      finally
         Free;
       end;
  +
  +    //
  +    // The package version has been checked earlier at the start of the
  +    // build. So now copy it into the kmp.inf/kmp.json data
  +    //
  +
  +    if pack.KPSOptions.FollowKeyboardVersion then
  +    begin
  +      if kmpinf.Keyboards.Count = 0 then
  +      begin
  +        FatalMessage('The option "Follow Keyboard Version" is set but there are no keyboards in the package.');
  +        Exit;
  +      end;
  +
  +      FPackageVersion := kmpinf.Keyboards[0].Version;
  +
  +      for i := 1 to kmpinf.Keyboards.Count - 1 do
  +        if kmpinf.Keyboards[i].Version <> FPackageVersion then
  +        begin
  +          FatalMessage(
  +            'The option "Follow Keyboard Version" is set but the package contains more than one keyboard, '+
  +            'and the keyboards have mismatching versions.');
  +          Exit;
  +        end;
  +      kmpinf.Info.Desc[PackageInfo_Version] := FPackageVersion;;
  +    end;
  +//    else
  +//      FPackageVersion := kmpinf.Info.Desc[PackageInfo_Version];
  +
  +
   
       kmpinf.RemoveFilePaths;
   
  
positive.code: 
      FOutputFileName: string;
      FTempFiles: TTempFiles;
      FPackageVersion: string;
  
      procedure FatalMessage(const msg: string);
      procedure WriteMessage(AState: TProjectLogState; const msg: string);   // I4706
  
negative.code: var
    kmpinf: TKMPInfFile;
    psf: TPackageContentFile;
    FPackageVersion: string;
    i: Integer;
    f: TTempFile;
  begin
  