47

Question for indie Mac developers out there:

How do I implement a 30-day time trial in a non-evil fashion? Putting a counter in the prefs is not an option, since wiping prefs once a month is not a problem for an average user. Putting the counter in a hidden file somewhere sounds a bit dodgy - as a user I hate when apps sprinkle my hard drive with random files. Any ideas?

Jonas
  • 121,568
  • 97
  • 310
  • 388
svintus
  • 1,562
  • 2
  • 18
  • 22
  • 22
    One suggestion: Instead of making it 30 days since X date, how about making it X hours of continuous usage? Unlike a 30-day trial, the X-hours-of-real-use trial will probably leave me with time to apply the app to a real task 31 days after I take a superficial look around your UI the first time. This doesn't really answer your question (where to put the trial info), only modifies it slightly (what to put there: number of minutes used vs. date of first launch). – Peter Hosey Jan 07 '10 at 17:32
  • 2
    Consider deploying through Steam. They manage all the DRM you need. – Thorbjørn Ravn Andersen Jul 24 '13 at 10:23
  • I have used the config file version and registry key keeping process when developing softwares. But both these breaks if the user formats the machine and re-installs it. A 30 day trial can be used again even after expiration after getting the machine formatted. But in the case of microsoft softwares, those can't be installed even after a format. What logic could that be? – Nisha Mar 11 '14 at 06:45
  • There's a neat article by Allan Odgaard on how to make a license key for an application using OpenSSL. You can include an expiration date in your license key and always require a valid license, but hand out 30-day licenses on your web site. If a user keeps requesting trial licenses over and over, you'd at least be able to count it and refuse them eventually. http://sigpipe.macromates.com/2004/09/05/using-openssl-for-license-keys/ – uliwitness Aug 20 '14 at 13:31

9 Answers9

64

This issue comes up repeatedly on the cocoa-dev mailing list and the consensus answer is always do the simplest thing possible. Determined hackers will break all but the most over-engineered solution. And they're unlikely to pay for the software anyways. Go for the 80/20 solution: the easy solution that gets 80% effect for 20% effort. In this case, putting something in ~/Library/Application Support/your.app.com/. You might name the file something innocent if you want to obfuscate things just a bit. Using the user defaults is easy too.

Whatever you do, don't use the MAC address or an other hardware ID. Users with a network home directory (e.g. in a shared lab setting) will hate you. Using hardware IDs is just evil.

If someone is in love with your program so much that they're willing to break your trial limits, let them. The free software costs you nothing and their good will (and maybe recommendation to others) is worth a lot.

Finally, write software that people want to use and price it for its value. If your price is a good value and people want to use it, most people will pay for it.

Barry Wark
  • 107,306
  • 24
  • 181
  • 206
28

I would suggest to implement few of things which are less intrusive and may avoid a normal user to either uninstall or buy at one month period.

  1. Use a special series of trial-serial number which stores expiry date in it. You can use encrpytion to store expiry date within the serial number.
  2. Now create a configuration file which stores data in the encypted format and contain the serial number.

Additionally implement these things in the config file.

  1. Make a note of time/date every time user starts the application.
  2. Note the duration of the time application was open.

By doing the logging of timestamp you can avoid these workarounds:

  1. If user reverses the computer date, you would know that app was already run on that day. Say user ran app on 1 and 3 day of month. Now after 30 days reverses the date and sets it to 2nd of month. Now by config file you would know that app already ran on 1 and 3 so user has messed up dates on the computer.
  2. Let’s say every time user starts your app by first setting date to 5th of the month. By logging your application running time you would see that if the total hours in a day exceed 24 then user is fooling around.

Ensure that your app doesn’t run without the config file. So essentially you send the encrypted serial number in a file or maybe upon entering the serial number you can create file. Since the serial number already has the expiry date user can’t reuse the serial number also.

I would not suggest the internet way because people get pissed off when app tries to connect to server every time. Plus, one may get suspicious that you trying to send some personal data of users to your servers.

One thing I would like to say: No matter how strong the anti-piracy technique you use, someone is bound to break it. You are not making your app for those guys. You are making your app for people who would like your software and will buy it happily. So have the anti-piracy in limits without losing the genuine customers by making your application too intrusive during the trial period. One thought also says, if your software is getting cracked that means it’s getting popular also. Again opinions may differ and would not like to digress on these issues.

K Singh
  • 1,710
  • 1
  • 17
  • 32
13

Consider this. How many potential users of your software are out there, just itching to use it solidly for the next 30 days?

I suspect the far more normal case is: Users encounter a new software package that solves a problem they've had on a site like lifehacker.com. the software gets downloaded, played with briefly, then put aside. Perhaps its mp3 ripping software and they don't have any cd's to rip at that time. Or they're just busy that day, but they'll get round to reviewing that software 'soon'.

30 days pass. Probably more. Only Then do they buy a CD, encounter some sort of 'problem' and remember, 'aha, theres that trial version I downloaded! Where did I put it again?' It doesn't matter. Without ever being used, the 'trial' has timed out.

I can't count the number of software tools that have fallen into that bucket for me. The day a piece of software is recommended to me, the day I see a positive review on lifehacker, is NEVER the day I actually have a need - or even the time - to use / analyse the program I've downloaded and intalled.

Chris Becke
  • 34,244
  • 12
  • 79
  • 148
  • Mmm, very good point, thanks. Now, this depends on the type of the app and what it does, of course. I'll definitely consider this. – svintus Jan 08 '10 at 16:22
9

Having the software expire after 30 calendar days is bad because what if someone downloads it, runs it once, and then decides they'll evaluate it a month later? Next time they launch it, a month later, it'll say it's expired.

I'd go with having it limited to 14 launches, or something like 120 minutes of use.

As for implementation, a file (hidden or not) in the user's Preferences folder, with an obfuscated name, seems like the best way to go. The file isn't randomly placed on the hard drive, but the user can't easily figure out which file to delete.

lucius
  • 8,665
  • 3
  • 34
  • 41
5

The least evil way is to just ask the user to delete the program after one month or pay for it ;)

Andreas Brinck
  • 51,293
  • 14
  • 84
  • 114
  • 12
    Unfortunately, users would be the "evil" ones by not holding themselves to that. –  Jan 07 '10 at 18:22
4

We did it for one of our client application. Granted it was done in .NET for Windows, but the same principles can be applied in MAC.

Like eckesickle mentioned, if your user have access to the internet (or should), then you can have a web service that will register some unique id from the host computer with the starting date trial (MAC adress is a good one). With this, the user cannot really cheat the program unless he chances his network card every month.

Now, if the user doesn't have access to the Internet for some reason, you can either shut down the program until he connect to it or use a grace period. This file records the last time the app is opened. When the Internet is not accessible, we stop writing the time (we still write something in it so the user doesn't notice the file is not updated).

Should a user notice that this file contains the information and delete it (or change it using a copy he has), then you need a way to counter that. You can have some other value in another config file (encrypted always) and check for consistency. What you do if you discover that the user is trying to cheat is up to you, but we force the user to connect to the internet for it to work.

It might be overkill for a program, but it definitly works.

David Brunelle
  • 6,528
  • 11
  • 64
  • 104
  • Why the downvote? If there is a flaw in my security, I would like to know what it is since we are implementing this on one of our app. – David Brunelle Jan 07 '10 at 15:52
  • 1
    One possible issue is that it's trivial to change the MAC address, so if you're using the MAC address as your unique ID, your protection is easily circumvented. (I wasn't the one that downvoted your answer btw) – Chinmay Kanchi Jan 07 '10 at 17:47
  • 1
    Forgot to mention, we also use other ID from the computer hardware, but I didn't know it was possible to change a MAC adress. – David Brunelle Jan 07 '10 at 18:00
  • Yeah its just a registry key that you change. On reboot of the device (or windows I forget which) the new MAC address is "spoofed", and the device uses the new address as long as the reg key is there. Also I +1 you, I like your approach, it goes against all the "they will hack it anyways if they want so don't bother crowd". – Anonymous Type Dec 22 '10 at 00:06
  • Perhaps the biggest issue is what if the internet is down, your server is down or for whatever reason the app install cannot be authenticated? It gets complicated from that moment on. – Jason Fuerstenberg Apr 19 '12 at 05:00
  • We implemented a 3 days 'grace period' should something like this happen. Some minor config is saved on the comp in en encrypted file so that it acts like it's online. After that, the user had to connect to the internet. – David Brunelle Apr 20 '12 at 12:36
3

I used to offer a 30-day lite edition of my iOS app that embedded the install date and various record dates in the export data file that the user could download to his/her computer.

If the user was a cheapskate and just reinstalled the lite edition and tried to re-import the data, logic would notice that at least one of the date was older than 30 days and the app would set its install date to the earliest such date from the file, rendering it expired again.

In the full paid edition, this logic didn't exist and the data file could be imported easily.

It was a pain supporting people in this data migration (since apps are completely sandboxed from one another) and some other users felt the lite edition was enough for them so they never upgraded.

I've since stopped offering my lite edition and just reduced the price of the full edition. Now potential customers just have to pay a small amount or go find some competing software.

All in all, that was the best strategy for getting paying users.

Jason Fuerstenberg
  • 1,341
  • 13
  • 13
3

At the time of download, provide them with a trial serial number. When they enter the serial number, have it connect to your server and gets expiration information (stored and encrypted locally to prevent any additional "phone home" calls).

By doing it this way, you make it fairly hard for them to get around your 30-day window, as the expiration date is permanently stored on the server. You could set it up so deleting the key and re-entering it would cause your application to connect to your server again and download the same expiration date as before.

Or you can do it like WinZip does (or used to do it?): Provide a 30-day trial and just pop-up a screen at every load that shows how long you've been using it and links to purchase.

Brad Butner
  • 310
  • 1
  • 11
1

Read an UUID from some hardware component and make a check against your web service to see if your software has already been installed for 30-days upon program launch?

Fredrik E
  • 1,840
  • 13
  • 18
  • 11
    Calling home is even more evil than leaving shady files around, IMHO. – Virgil Dupras Jan 07 '10 at 15:12
  • 2
    Do you think E.T. was evil too? One still has to call home and get a serial number the first time the program is run if there are no preferences. I honestly don't see the harm in sending an UUID when doing this. It's what OP asks for ... – Fredrik E Jan 07 '10 at 15:16
  • I should clarify. One needs to send the UUID calling home if one wants to save the paying user the hassle of re-entering registration details on a computer that has already been authorized. :D – Fredrik E Jan 07 '10 at 15:18
  • 2
    Sounds reasonable, since the app needs an internet connection to be useful anyway. I don't think that it's evil in any way - I won't be getting any data from the user but his UUID (MAC address, for example). – svintus Jan 07 '10 at 15:35
  • Some users would consider this an invasion of their privacy. You might end up losing more customers than you gain by doing this. But then again, it's your call (home! hehe). And don't forget the possibility of a bug in your implementation of this scheme preventing possible customers from even trying your app. – Virgil Dupras Jan 07 '10 at 15:43
  • I don't see anywhere that the app need the internet to run, but rare are those that do not have the Intenet. Most likely the person downloaded it anyway... – David Brunelle Jan 07 '10 at 15:45
  • 2
    Do you seriously think that accessing a user's MAC is an invasion on their privacy? As soon as you connect to _any_ network, you're effectively giving away your MAC. – svintus Jan 07 '10 at 16:04
  • 2
    @svintus: In normal usage, you only broadcast your MAC to the local network, not outside of it. – C. K. Young Jan 07 '10 at 16:09
  • It doesn't matter much if what I think is reasonable or not. Maybe that a fair part of your potential customers will not be reasonable either. Do you only want customers who have the same opinion as you regarding apps that call home? I don't know, so far, my first comment has 4 upvotes. That's probably 4 people who wouldn't willingly use an app that calls home. 5 if you count me in. You have to do the math and determine if your scheme will bring you more customers than it will make you lose. – Virgil Dupras Jan 07 '10 at 16:12
  • 2
    Agreed, people have strange concepts of privacy. – svintus Jan 07 '10 at 17:02
  • Using a hardware UUID will guarantee that your user experience sucks for users on a network home directory or who have mobile home accounts synchronized across multiple computers. – Barry Wark Jan 08 '10 at 01:11