Nigel
Nigel

Reputation: 500

How to deploy a .NET application that will expire after a certain time or number of uses

We would like to be able to create intermediate releases of our software that would time-bomb or expire after a certain fixed time or number of uses that would not easily be manipulated. We are using Visual C++ with mixed native and managed assemblies.

I imagine we may need to rely on a registry tag but this seems to be insecure.

Can anyone offer some advice on how to do this?

Upvotes: 3

Views: 417

Answers (6)

Austin Salonen
Austin Salonen

Reputation: 50225

You could deploy it as a ClickOnce application with a certificate that expires at a certain date. If I recall correctly, the app will err on startup after that date.

A couple caveats:

  1. The only option for the user may be to uninstall the app, which is a jerk move.
  2. You will end up maintaining a ton of different deployments.
  3. It will be a shock to the user as it will just happen without warning.

Upvotes: 0

Florian Doyon
Florian Doyon

Reputation: 4186

Have the binary download a tiny bit of code on startup from one of your servers.

Keep track of the activation counter on the server, when the counter reaches the limit, return a piece of code that displays the 'sorry!' message.

Upvotes: 0

Developer
Developer

Reputation: 126

Set a variable to a specific date in the program then every time the program is run access the system date and check if that date is equal to or greater than the specified date. If true then start the expiry process and display a message or alert panel to the user.

Upvotes: 0

light
light

Reputation: 816

I was working on a "trial-ware" solution a while back and it used a combination of registry keys, information stored in a flat-file at a certain position surrounded with junk data, and then also had an option to reach out to a webservice that would verify it back with the software creators.

However, as FrustratedWithFormsDesigner stated, there is no 100% fool-proof way to do this. There is always a way that a hacker can get around whatever precautions you put in place.

Upvotes: 1

Steve Townsend
Steve Townsend

Reputation: 54148

This is very hard if not impossible to do in a foolproof way. In any event, there's nothing to stop somebody removing and reinstalling the software (you do support that, right?).

If you cannot limit the function of these intermediate releases (a much better incentive for people to move to official bits), it might be more trouble than it's worth to implement such a scheme.

Upvotes: 0

Tony Abrams
Tony Abrams

Reputation: 4673

If you are using a database for the application, then it might be better to store a install (datetime) and a numberofusers (int) and then make code that checks those fields when the program is starting / loading / initing. If they are past a certain number or time (this could also be in the db) then exit the program.

Upvotes: 0

Related Questions