Question

C# 2008 SP1

I am writing an application that I want to give to a select number of customers.

What is the best solution to use so that after the trail period (1 month) the application will no longer work.

I was thinking that if they are interested in purchasing the software I will give them a license key or something, to unlock the application.

I am have a very limited budget as I am working on my own. So is there any free 3rd party products that does this?

Was it helpful?

Solution

If you go with a date-based approached, it can be circumvented by a user's setting their date back (although I doubt people do this very often). An alternative is to allow the application to be started a certain number of times before expiring; this approach obviously ignores any date changes.

My preferred method is to disable parts of the application that are critical to normal use of the program but aren't critical to its evaluation (like the ability to save your work, for example). I do this with my own software, and then send them an unlocking code unique to their computer when they purchase the full program. One primary advantage of this approach is that the installed demo functions as a potential sales tool forever. I'd rather have my program always working to some extent; I don't think a "Sorry, this program has expired" message generates many sales.

OTHER TIPS

Your options:

  1. At the installation write something to the registry, so that it is hard to find and remove later. This way your application will know when it was originally installed and whether it should still work right now or stop. This method will fail if the registry is cleaned well or if the OS is reinstalled.

  2. Use some sort of online validation service. Will be free of the disadvantages of the [1]. Will also allow you to monitor application activity transcending the OS installation. For that to work you will need to somehow uniquely identify a user PC and transmit its signature to your server.

Here is the trick i did to stop users from playing with date/time settings and back dating the clock.

When the app runs for the first time, encrypt the first run date and end trial date and last run date in registry. And decrypt and check the end trial date and not system date from there on everytime the app runs. This solution works for users with no internet connectivity.

Write a registry key during your installation. The key will contain the date of the installation. The date in the registry key must be encrypted.

When your application is started, check for the existence of this registry key. If it does not exist close the application else decrypt the date, check the trial period and close the application if the trial is over.

The simplest solution (and as a result the simplest to circumvent) is to store the date the program is first installed (or run) in a file and then check that against the current date whenever the program is launched. If the difference is > 30 days then exit the program.

By storing the date in more obscure places or places that are harder for the user to tamper with (such as the registry) then it gets progressively harder for them to circumvent the system and get more time to use it, but doesn't stop them rewinding the clock on their PC.

If you store the date on your server and also get the date from your server then this is more secure, but does mean that the user has to have an open internet connection to use your software.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top