Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trial period for WPF app and ClickOnce

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.

like image 275
Nuts Avatar asked Apr 08 '14 14:04

Nuts


1 Answers

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.

like image 188
Peter M Avatar answered Oct 15 '22 22:10

Peter M