Recent

Author Topic: Onguard expiration date error  (Read 2135 times)

andrewcass

  • New Member
  • *
  • Posts: 14
Onguard expiration date error
« on: April 28, 2023, 12:08:13 pm »
Hi all,

I'm trying to use onguard, but the expiration date option seems not to be working.
Anyway, i tried the example 'Exdttp21', witch is a 'expiration date' example, and it doesn't work too. I always got 'Invalid code'.
Running step by step i observed that the 'OnGetCode' event never starts!
That could explain why the package can't work properly.
Someone got this done? Need a tip!
Thanks

wp

  • Hero Member
  • *****
  • Posts: 12296
Re: Onguard expiration date error
« Reply #1 on: April 28, 2023, 01:21:09 pm »
The DateCode component has the "StoreCode" property set to true. I think this prevents the demo program to enter the OnGetCode event.

After resetting StoreCode to false and deleting the demo's ini file the projects starts correctly and creates a new ini file with a datecode valid for 21 days. In order to test expiration, I ran the demo program CodeGen and created a datecode which already would be expired today and pasted this code into the demo's ini file. Running the demo again now I get the message that the code is expired. So, I think, the only issue is in the incorrect property setting.

andrewcass

  • New Member
  • *
  • Posts: 14
Re: Onguard expiration date error
« Reply #2 on: April 28, 2023, 06:14:43 pm »
Hi WP;

Thanks a lot for your help. The example works fine now.
But something odd continues to happen: The calculated code (grammatically)  is different from given by the 'Code Generator'
dialog!
The code property (hex string) of the OgDateCode component seems to be useless, the property returns an empty string!  So, if i use the code generated by the dialog and let it
stored on 'Code' property of component 'OnGuard' won't work too?
Thanks for your kind help
« Last Edit: April 28, 2023, 06:19:53 pm by andrewcass »

wp

  • Hero Member
  • *****
  • Posts: 12296
Re: Onguard expiration date error
« Reply #3 on: April 29, 2023, 01:33:38 am »
OK, I don't fully understand this question. But maybe you have problems generating the code for the sample application. The code is a combination of the application-specifiec "Key" and the start and end dates of the test period. The Key is hard-coded at the top of the main form unit as constant CKey. Based on this key you can generate the date code in two ways:
  • automatically: Delete the ini file, delete the string in the Code property of the object inspector and uncheck the StoreCode property. When you now run the sample application a code will be generated from the Key, the current date and a usage period of 21 days. It will be stored in the ini file of the demo application
  • manually: Check StoreKey to indicate that the Code should be stored in the lfm file. You can delete the ini file to avoid confusion. Click on the '...' next to the Code property.  Click on "Code" to open the "Key maintenance" form. If not yet done, click on "Add" in the "Applications" box, enter the name of the application (exdtp21) and CKey value mentioned above ($E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4 - I put the 16 bytes into a single line) --> OK. Select the new application in the applications box. The CKey value appears in the Key field. Now click "OK" - this opens the "Code Generation" editor. Specify the first and last dates the application is allowed to run. Check that the CKey is listed in the "Key" field in the "Key used to encode" box. Click "Generate". This creates the DateCode which appears in the Code property of the object inspector after clicking "OK". Run the application; depending on the date range that you entered you will be notified whether the code is valid or has expired.

 

TinyPortal © 2005-2018