7

I have made a desktop application in kivy and able to make single executable(.app) with pyinstaller. Now I wanted to give it to customers with the trial period of 10 days or so. The problem is how to make a trial version which stop working after 10 days of installation and even if the user un-install and install it again after trial period get over it should not work. Giving partial feature in trial version is not an option.

Evnironment Mac OS and Python 2.7 with Kivy

Ryabchenko Alexander
  • 10,057
  • 7
  • 56
  • 88
Kumar Roshan Mehta
  • 3,078
  • 2
  • 27
  • 50
  • 1
    most commercial software use keys, and require the software to be connected to the internet to "phone home" and make sure that those keys are valid. – James Mertz Aug 12 '14 at 16:56
  • Can you suggest any installer for MAC something like inno for windows ? – Kumar Roshan Mehta Aug 12 '14 at 16:59
  • I honestly don't know of anything like this. I just know that most software companies have the backend and funding to be able to take care of these things internally or with very expensive third-party software. – James Mertz Aug 12 '14 at 17:13
  • Also the timestamp needs to be written/encrypted somewhere in HDD, btw you can use hardware prefs as constants to generate a publickey for purshase, the private key is provided accordingly. – Abr001am May 22 '20 at 11:43

3 Answers3

6

You need a web server and a database to get this working.

  • Create a licenses table in your database.
  • Each time a new client pays for your software or asks for a trial, you generate a new long random license, insert it in the licenses table, associate it to the client's email address and send it to the client via email.
  • Each time a client tries to install the software on their computers, you ask for a license and contact the webserver to ensure that the license exists and is still valid.

Using that, people can still just create multiple emails and thus potentially get an infinite amount of trial versions.

You can then try to add a file somewhere in the person's computer, a place where nobody would ever look for, and just paste the old license there so that when the app starts again (even from a new installation), it can read the license from there and contact the webserver without asking for a license. With this method, when your app contacts the server with an expired trial license, your server can reply with a "license expired" signal to let your app know that it has to ask for a non-trial license now, and the server should only accept non-trial licenses coming from that app from now on. This whole method breaks if your clients realize that your app is taking this information from a local file because they can just delete it when found.

Another idea that comes to mind is to associate the MAC address of a laptop (or any other unique identifier you can think of) to one license instead of an email address, either at license-creation time (the client would need to send you his MAC address when asking for a trial) or at installation time (your app can check for the MAC address of the laptop it's running on).

Piero Hernandez
  • 435
  • 4
  • 10
2

1) you can hardcode in app timestamp after witch it will stop working and check on each run if this timestamp greater then time.time(). This approach will work if you have one customer or few customers and able to make trial version with different dates for each of them.

2) use platform/sdk for licence like https://cryptolens.io/ or other

3) write you own solution, maybe How to generate and validate a software license key? will help you

Ryabchenko Alexander
  • 10,057
  • 7
  • 56
  • 88
0

My idea is

  1. Make a table in database
  2. Use datetime module and put system date in that table as begining date
  3. Use timedelta module timedelta(15)( for calculating the date that program needs to be expired here i used 15 day trial in code) and store it in table of database as expiry date
  4. Now each time your app start put this logic that it checks on if current date is matches with expiry if it does show error it is expired of your explicit logic

Note:- make sure begining and expiry runs only once instead date will be changed again and again.