views:

149

answers:

2

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.

+4  A: 

I believe you are thinking too complicated. Why not make it like a trial version that expires n days after installation, first use, or whatever you wish.

About the deleting the exe approach: Be careful, this could be an illegal intervention in somebody elses computer.

Treb
also, you may come across people who install as administrator and run as normal user. No administrator -> no deleting stuff in certain folders (like Program Files)
Piskvor
There's no exe, it's an Adobe Projector file. And when they buy licenses, they are agreeing to use of the file for an agreed upon amount of time. There is a concern that they will try not to renew the license and keep using the old one.
Elie
Right, but from a legal perspective, agreeing to cease using something is not the same as agreeing to have it deleted. Anyway, Piskvor's comment is a much more valid argument than mine ;-)
Treb
But if I set it to expire and no longer run n days after the install, how do I detect if they have changed the date on the system? I could use a license server, but currently there is not one set up, and many of the users will not have internet access.
Elie
+4  A: 

Not running software on a system when the trial period has expired is accepted today. I don't think actually deleting the program would be. I know I would never use such an application again.

Jim C
But how do you enforce that? OK, eventually pretty much any program can be hacked, but how do you prevent the client from changing the date on the machine or something like that to make your program think the license is not yet expired?
Elie