I have an application which get copied and run on client machines. The program is in the form of an Adobe Projector file. I want to write a process that checks when the program starts running whether or not the license is still active, and if not, delete the entire program.
The program itself knows the real date that it was installed, and since we install the program ourselves for the clients, we can ensure that at install time the date on the client's computer matches. Every time they start up the program, it compares the current date with the date they last ran the program. If today's date is after that date, it subtracts the number of elapsed dates from the number of days remaining. If the date is before the date it was last run, it penalizes the client by a constant number of days (this is to discourage the client from trying to reset the date on the computer and have their license never expire).
If they were to copy the entire directory over to a new machine, the installation date inside the program would not match the created date on any of the files in the directory, and it would treat this case like an expired license.
My question is this: is there a simple way to script this to run every time they start the application? We currently create a shortcut which could be pointed to a batch job, but what do you put in the batch job? Or is this approach for licensing completely wrong? People who buy this program will only buy time-limited licenses, and the program is run by copying and pasting a directory onto the target machine.