Another idea, maybe, put some code in to check a date at program startup, put that date in an external encrypted file, if check is not ok exit program.
And there is the potential problem. If you let the program create that encrypted file on first startup, the user can just remove that file after 30 days and the program will generate that file again.
The only way this is going to work is if the user gets the license-key from you. Also for the trial-version. So you would need to provide EVERYONE who downloads the program with a license-key.
Next problem is that the program can be copied and the same license-key is valid to everyone.
The best way would be to calculate a unique machine code (which OnGuard does) and the user has to "register" that code with his e-mail (or name) with you. You can create a unique license-key (again OnGuard) especially for that combination of machine-code and name and expiration date (I do this automatically online).
The problem with this method is that, even for the trial version, the user has to register and a key needs to be created (which can be a hassle for large number of downloads).
Another option would be to generate the trial key on startup but hide it really well in the registry or filesystem. So don't just save it in the program directory. But the program can still be copied or if the user runs a virtual machine it can go back to it's original state. And when running a monitor program on the trial program, it will be easy to see what the program does to generate the key and where the file is saved.
Now I want to try to install OnGuard. The readme file is probably fine, but not for a newbie:
The interested part of that link you mentioned is
http://wiki.lazarus.freepascal.org/Lazarus_Packages#Design_Time_vs_Run_Time_packageThe difference between design-time packages and run-time-packages.
The design-time packages contain components. Those are the icons in the component bar at the top. But sometimes a package doesn't need components to work. Sometimes a package contain just a library of functions you can use directly in code without dropping a component on your form. Those are the run-time-packages.
The design-time packages (with component-icons) are usually the ones with _design in the name. You'll always want to compile the run-time (without the design in the name) first (so all the functions are compiled) and the compile AND install the design-package.
(For now you can forget about the _fpgui package. It's for the fpgui in Lazarus if you use that gui instead of the standard one)
You already opened and compiled tponguard.lpk. So that's correct.
If you create a new program and want to use it's functions you can open the Project > Project inspector and choose Add, Add new requirement and choose the onguard package. Now the functions are available to you in your code.
If you want to use the components, for easy drop- and use functionality, you would need to install the design package.
Open the tponguard_design.lpk (the same way you did for tponguard.lpk).
Now you can run compile.
After that you need to do Use > Install.
Lazarus will compile itself and restart.
After that you have extra components on the componentbar.