Trial period for WPF app and ClickOnce
Asked Answered
E

3

7

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.

Elsworth answered 8/4, 2014 at 14:55 Comment(5)
It sounds difficult to enforce - you can probably only make a best attempt to enforce this since the client has control of their own machine and ultimately can circumvent any protection your application contains. A web service that returns an auth token could work but you would need to uniquely identify the target machine and also prevent users from duping the web service response and activating. Adding a marker somewhere (registry) might dissuade the average user but a technical user could find and remove the key allowing another trial period.Bangweulu
Check out this article: codeproject.com/Articles/473278/…Bangweulu
Sounds like a lot of controls for just beta-testing. What is the purpose? If this is a revenue thing then why not just withhold a critical feature or limit some features.Fleta
Charleh, the link is good and looks to be close to our requirements.Elsworth
Blam, this is not a revenue thing. We want to expose all features for testing. We just don't want that any early-version software is left "hanging" on anybody's computer. We also look this pretty thoroughly now since we anyway in the release version need a license control system and would be nice if it works the same way.Elsworth
T
3

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.

Tessie answered 8/4, 2014 at 15:23 Comment(8)
So... you implemented your own, then?Mangle
I'm having trouble finding any actual source code (or examples, or documentation, for that matter) using the original link provided. If you have links to those resources, could you add them to your answer?Mangle
@BTownTKD LHS side of that page where it says "download" hibernatingrhinos.com/downloads/rhino-licensing/latestTessie
As I said; the link contains no source code, examples, or documentation. That is a single binary with a BSD license text.Mangle
@BTownTKD I am using about 75% of the Rhino code, but re-arranged it a fair bit. I then added stuff on op of it.Tessie
Excellent - thank you! This appears to be an interesting resource which I had not heard of before, despite previously using Rhino Mocks.Mangle
@BTownTKD Its not the most modern c# code and the XML processing is clunky by todays standards.Tessie
Interesting, I will take a look. +1 for open source.Elsworth
M
0

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.

Mangle answered 8/4, 2014 at 15:5 Comment(2)
Here is your oxymoron .. enjoy! hibernatingrhinos.com/oss/rhino-licensingTessie
We prefer here something ready-made over our own implementation. We can also pay for the solution if it does the job and price level is "decent". So far the options seem to be to select one of the paid ones or rhino.Elsworth
C
0

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

Carabin answered 8/4, 2014 at 15:18 Comment(1)
That would be the easiest to set up but too easy to crack. In the beta-testing though maybe ok, but we'd like to achieve something that could also be used in the release version licensing.Elsworth

© 2022 - 2024 — McMap. All rights reserved.