.. _install_activate: 

Activating a |popy| Licence
############################

Brand new |popy| installations can be used for |trial_length| days 
on a trial period basis.

To continue using |popy| after this free trial period has expired, 
you must acquire and activate a licence for |popy|.

There are currently two licences for |popy|:-

|popy| *Academic* Licence
    A free licence for |popy| which may |not| be used for commercial purposes,
    provided to academic institutions and nonprofits.

|popy| *Commercial* Licence
    A paid-for licence granting the end user one year of |popy| 
    usage on a single machine for commercial purposes.
    A commercial license is required to use |popy| in work including 
    regulator submissions or published studies that are sponsored or funded 
    by for-profit organizations.

(All versions of |popy| have the same functionality; 
the Academically-licensed version of |popy| is not limited in any way 
compared with the Commercially-licensed |popy|.)

Once you know the type of licence you require, email us at |email| 
to get a product key and run

.. code-block:: console

    popy activate <product_key>
    
(where "<product_key>" is the product key we sent to you)
in a :ref:`open_a_popy_command_prompt` 
to activate your |popy| installation for 12 months, after which it will need
to be renewed.

Once you have activated your |popy| installation, run:

.. code-block:: console

    popy info

to check the activation status, where you should see something like:
    
.. literalinclude:: /reference/commands/popy_info_output_activated.inc
    :language: console 

which confirms that |popy| is now licensed.

If you see

.. code-block:: console

    INFO - product_key=None

or 

.. code-block:: console

    INFO - should_run=False

in the output then there has been a problem with the activation.
Email us at |email| and we will do our best to resolve the problem.

.. _deactivate_popy:

Deactivating a |popy| Licence
================================

A |popy| licence limits its use to a fixed number of machines. #
Once this limit has been reached, the licence must first be deactivated on 
one of the machines before |popy| can be activated on another.
(Remember to make a note of the licence product key before deactivating 
the licence.)

To deactivate a |popy| licence on a machine, run

.. code-block:: console

    popy deactivate

in a :ref:`open_a_popy_command_prompt` and then 

.. code-block:: console

    popy info

to confirm that the licence has been deactivated, as indicated by

.. code-block:: console

    INFO - product_key=None

in the output.
