Question

We're deploying .NET WPF app to beta-testers using ClickOnce. We want to set a expiration date after which the app doesn't open anymore. Fixed date or x days from the first installation are both ok. After the trial we ask the users to unistall the app from their computers. In case they don't do so, we want that the app doesn't open anymore.

Specific requirements:

  1. no possibility to reset the time by re-installing or any other manner
  2. the app should work also offline, without internet access, so checking the web server every time the app is run is not a best solution
  3. subsequent updates to app don't affect the expiration date
  4. we would like to be able to extend the trial period any time for any period by sending a new activation code or similar to user

I'm looking if there is some readymade solutions out for this (pretty common) thing, at least some basic mechanism to start working on.

Was it helpful?

Solution

I have used Rhino Licensing in a project(*) and it seems to cover most of your use cases. See Here for a tutorial, Rhino code on GitHub, Rhino code direct download (zip)

However if someone is determined enough then there is nothing you can do to stop them using your code

Rhino works by you generating a license file for your users that has date related information encoded in it. This is cryptographically signed and the app code validates it is all good. But all it needs to be defeated is to modify your code to take out the call to say if the license was good or bad.

My solution to someone modifying my code is "go ahead do it", as I will be signing my code with a digital certificate which can't be duplicated. So I can always say "Hey, here is the real code and if your code doesn't match then what has someone done to modify it?". Low level fear stuff, but there is nothing you can do short of standing over each user personally and making them do stuff.

(*) I did start with the base code but then hacked the crap out of it to get something that matched my desires.

OTHER TIPS

Essentially, you want to control the features and/or lifetime of your installed application. What you've described is "Software License Management." You are correct that this is a very common business requirement, but typically any ready-made solutions are going to cost you money. "Open-source software license management" would be kind of an oxymoron.

If you develop for an "app store" environment, such as Windows 8, or any mobile platform, the license management APIs are usually provided for you, are tightly integrated into the app-store environment. But for a regular Windows Desktop app, you'll have to 'pay up' for a commercial solution, or develop your own.

In the absence of free, ready-made solutions, you can find some articles here and there which might get you pointed in the right direction, for implementing your own solution.

you can create a hidden file, you put the first launch's date of the application and you configure the trial period in your code

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