Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make trial period for my python application?

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

like image 849
Roshan Mehta Avatar asked Aug 12 '14 16:08

Roshan Mehta


People also ask

How do I license a Python application?

To add license checking to a Python application you import the Licensing.py file into your application. You can then call the checkLicense function by calling Init to load the license information and check that the user has a valid license.

How much does it cost to build a Python application?

A number of tech experts are usually involved in the development of a single Python web app, including front-end designers, back-end programmers, testers, or quality assurance individuals. Typically, a web development company will put a price quote of $3000-$30,000 for developing a Python web application.


2 Answers

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).

like image 131
Piero Hernandez Avatar answered Oct 17 '22 00:10

Piero Hernandez


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

like image 42
Ryabchenko Alexander Avatar answered Oct 16 '22 23:10

Ryabchenko Alexander