home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / RKPLUS33 / RKPDEMO2 / BRAND.PAS next >
Pascal/Delphi Source File  |  1993-10-19  |  2KB  |  69 lines

  1. Program Brand;
  2.  
  3. {
  4.  This is a sample program using RkPlus.  It is a sample of a software
  5.  branding programme that would be used by the user to enter their name
  6.  and registration key and modify the EXE file.  This sample will brand
  7.  the Sample4 programme, using a registration key which would be generated
  8.  by the programmer using the GenKey program.
  9.  
  10.  Brand uses the Rkp2Enc unit to cause RkPlus to maintain version
  11.  2.x/compatible keys.
  12. }
  13.  
  14.  
  15. Uses
  16.   Crt,
  17.   RkPlus,
  18.   Rkp2Enc;
  19.  
  20.  
  21. Const
  22.   MonthNames : Array[1..12] of String[3]
  23.   = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
  24.  
  25.  
  26. Var
  27.   kc          : Char;
  28.  
  29.  
  30. Begin
  31.   OwnerCode := 'ArgleBarbWotsLeeb';
  32.   ProgramCode := 'Sample';
  33.   SetKeyFile('Sample4');
  34.   WriteLn('Brand');
  35.   WriteLn('Software Branding Programme for Sample4');
  36.   WriteLn('See RKPLUS.DOC for more info');
  37.   WriteLn;
  38.   Write('Enter name of person to register : ');
  39.   ReadLn(Rkp.Name1);
  40.   WriteLn;
  41.   Write('Enter the registration key : ');
  42.   ReadLn(Rkp.Key);
  43.   WriteLn;
  44.   Rkp.ID := '(c) Serious Cybernetics';
  45.   Rkp.Message := 'Brand';
  46.   Rkp.Name2 := '';
  47.   Rkp.Name3 := '';
  48.   Rkp.Level := 0;
  49.   VerifyKey;
  50.   If Not Rkp.Registered then Begin
  51.     Rkp.Level := 1;
  52.     VerifyKey;
  53.   End;
  54.   If Not Rkp.Registered then
  55.     WriteLn('Invalid key!')
  56.   Else Begin
  57.     Write('Branding ',ExeFileName,'...');
  58.     BrandRegInfo;
  59.     WriteLn;
  60.     WriteLn;
  61.     If RkpOK then
  62.       WriteLn(ExeFileName,' branded.')
  63.     Else If (RkpError = InvalidFile) then
  64.       WriteLn(ExeFileName,' is not a valid RkPlus file!')
  65.     Else
  66.       WriteLn('Error ',RkpError,' branding ',ExeFileName,'.');
  67.   End;
  68. End.
  69.