Limiting number of times a software executes

I want some of my important software to execute only 10 or 15 times if they are in pen drive, so no one can use it much more....even if he copies the app to some other place the software should not run........
 
The only way I could see that working properly would be to have it require authentication to a server. When it authenticates it counts 1 tick towards the counter. At 15 authentications it would indicate that it's been ran too many times and to re-authenticate/create a new key. Something similar to how PKI works.
 
All solutions require a modification to the existing application.

If you can modify the source, another approach is to give xx days after the first execution.
cases:
  1. fist time, find encoded timestamp file, not found -> immediately die(), else if date == original date, set new date
  2. verify date encoded <= today -> run, else die();
no server required, just your ability to encrypt and decrypt a date
 
Back