.. 
    .. _activation:

    |popy| Activation
    #################

    |popy| comes with a |trial_length| day trial period.
    To continue using |popy| after this period has expired,
    you will need a :ref:`licence<licences>` to activate the product.


    .. _licences:

    Licensing
    ============

    There are currently two licences for |popy|:-

    |popy| *Academic* Licence
        A free licence for |popy| distributed to academics, which may |not| be used for commercial analyses.

    |popy| *Commercial* Licence
        A paid licence granting the end user one year of |popy| usage on a single machine. A commercial license is required to use |popy| in regulator submissions or publications regarding work that is sponsored or funded by drug companies |ie| research that leads to profit.

    Both licences comes with a |trial_length| day trial period, so you can try out |popy| before obtaining a |prod_key|.
    
    All versions of |popy| have the same functionality. There are no *crippled* versions. 

    Any version of |popy| can be upgraded to the latest version of |popy| at any time. The terms of the licence (|ie| duration |etc|) are unaffected by upgrading |popy|. 

    Please email |email| for further information or to obtain a licence.

    .. _activation_activate: 

    Activate |popy|
    ====================

    |popy| comes with a |trial_length| day trial period. To continue using |popy| after this period has expired, you will need to email |email| to get a :ref:`licence<licences>`.

    When you have a licence key, :ref:`open_a_popy_command_prompt` and type:

    .. code-block:: console

        popy activate <product_key>
        
    (where ``<product_key>`` is the product key we sent to you in an email) to activate your |popy| installation.


    .. _activation_status: 

    Activation Status
    ===================

    Once you have activated your |popy| installation, :ref:`open_a_popy_command_prompt` and type:-

    .. code-block:: console

        popy info
        
    and you should see something like this:-
        
    .. literalinclude:: /reference/commands/popy_info_output_activated.inc
        :language: console 

    showing the paths used by |popy|, a few internal variables, and details about the licence (if you have run :ref:`popy_activate` successfully).

    If you see output like this:-

    .. code-block::

        INFO - product_key=None

    Then |popy| is not yet activated. The trial period may or may not be active, which determines if |popy| will run without a |prod_key|. 

    .. comment 

        If you see the following:-

        .. code-block::

            INFO - should_run=True
            
        then |popy| is within the trial period.

    If you have a |prod_key|, but this line is displayed:-

    .. code-block::

        INFO - should_run=False

    Then the |prod_key| is invalid and you need to obtain a new |prod_key| to successfully :ref:`activation_activate`.
    
    .. _deactivate_popy:

    Deactivate |popy|
    =================

    To remove a |popy| |prod_key| from your machine, open a :ref:`open_a_popy_command_prompt` and type:-

    .. code-block:: console

        popy deactivate

    .. _verify_deactivation:
    
    Verify Deactivation
    -------------------

    Run:-

    .. code-block:: console

        popy info

    and you should see something like this:-

    .. code-block::

        INFO - product_key=None
    
    .. _transfer_product_key_between_machines:

    Transfer Product Key Between Machines
    =====================================

    If you wish to move a |popy| licence from one computer to another. Then you simply need to :ref:`deactivate_popy` on the current machine, noting the current |prod_key|. And then :ref:`activation_activate` on the new machine, using the same |prod_key|.

    Note if you activate the same |prod_key| on multiple machines and you exceed the number of activations associated with the |prod_key|, this will invalidate your licence and may cause problems.




    Note that if you are moving your |prod_key| to another machine, it is wise to :ref:`deactivate_popy` before uninstalling. If you are upgrading |popy| then it is best to keep the current product key.
