# License Code Management

    ⚠️ This information is irrelevant with Setapp builds. If you are using Downie via Setapp, the following does not apply.

When you purchase Downie, you receive a license code that is in the following format: `XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX`. When you first install Downie, it will prompt you to enter the license code. As each license code comes with a limit how many times it can be used (default is 3), it is advisable to deactivate the license code prior to moving to a new computer and discarding/reinstalling the old one. To do so, select `Downie > Deactivate License Code...` in the menu bar. If you have Downie running only in the menu bar, this menu item is under the menu within the popover that appears when you click on the menu bar icon.

Under some circumstances, you might want to automate this - e.g. if you switch between computers on regular basis, or if you want to deploy Downie across multiple computers. Starting with Downie v4.4.5, you can automate both activation and deactivation of the license code via command line.

### Activation

    open 'downie-license://activate?email=my@email.com&license=XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX'

This will try to activate the license code `XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX` under the email address `my@email.com`. Both `license` and `email` query items are required.

Note: If the app is already activated, then this command will be ignored.

### Installing License Code for All Users

If you have multiple users on your computer and want to install the license code so that all of them are activated, create a folder `com.charliemonroe.Downie-4` in `/Users/Shared/`. Downie will then use this folder for license code storage and it will be used across all users on that computer.

Note: Due to the nature of this, the license code is automatically hidden from the UI (see below).

### Deactivation

    open 'downie-license://deactivate?email=my@email.com&license=XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX'

This will try to deactivate the license code `XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX` under the email address `my@email.com`. Both `license` and `email` query items are required.

Note: If the app is already deactivated, then this command will be ignored. The command will also be ignored if the license passed in the command does not match the one that’s used in the app. This is to prevent malicious license code deactivation.

### Hiding License Code from UI

If the computer on which you are installing Downie is publicly accessible (in a school, library, etc.), it is advisable to hide the license code from the UI to prevent it being shared by other users. By default, when you select `Downie > Show License Code...` in the menu bar, it will be displayed - this is so that you can retrieve it when necessary, but it also has the downside of being accessible to anyone.

There are two ways to hide the license code from the UI:

- run the following command: `defaults write com.charliemonroe.Downie-4 CMHideLicenseCodeFromUI -bool YES`
- or add `&hide=true` to the activation command, i.e.: `open 'downie-license://activate?email=my@email.com&license=XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX&hide=true'`

This will cause the license code to be obfuscated in the UI and all log files.