I wrote a library to do this with NSIS, including an activation key system that allows for expiring keys. If I can modify it enough to post it here without giving away the original algorithm at all I can post it here.
You can do some cool stuff with this. What I do is I code installers for people, and I protect the installer with a 30-day trial period (what you're looking for) but I also use DcryptDll to encrypt the installer's source code and package it into the installer. When my client buys a license to use the installer commercially, I send them an activation key (which expires after a set number of days) and a decryption key, which unlocks the installer's source code. When the activation and decryption keys have been validated, the installer decrypts/extracts the installer's source code, spawns an NSIS compiler (about 500kb packed with LZMA compression) and rebuilds an installer without the protection, encryption, or 500 extra kb of overhead.
If all that sounded a little complicated, don't worry. The secure clock library (affectionately called "ClockLock") is relatively easy to implement and can allow for custom code upon validation success/failure. It also protects against clock set-backs (an old cheat) and fraud keys. It even confuses registry-monitoring programs like SysInternals Regmon.
Again, I cannot post it here unless I drastically change it, because then my clients can steal the installer sort of. I can privately license it to you for a negotiable price (it took me a long time to develop) and provide tech support, examples, a keygen, and several other tools or I can just post the thing here but I can't provide any considerable help for it.
One major bug: Nothing works across years. Of course this is March, so this isn't a problem for now.
Here's a working example:
http://www.freewebtown.com/dandaman3...ureNotepad.exe
This example only has one big vulnerability: it extracts the program file and runs it. User can copy it to another folder and rename it, voila no time limit. But everything else seems to work fine.
Unlock key: 635433-955166-776584-010880-182012 (expires 90 days from this post)
To do some cool stuff with registration: run SecureNotepad.exe /RegInfo.
I have a sample encrypted installer too, if anyone wants to see that...
-dandaman32
Contains windows notepad, (c) micros0ft