How to add license without License manager?

We would like to make it easier for our model users using Plecs Blockset.
Is there a possibility to check scriptbased (e.g. from Matlab) if the user has a valid license?
Additionally, how can we add also via script (without the license manager) a valid license if available locally but not yet properly activated.

To check out a license for PLECS, enter: [success, message] = plecs(‘checkout’)If the check-out succeeds, the return variable success will be set to 1 and message will be an empty string. Else, success will be set to 0 and message will contain a detailed error message. When called without left-hand side arguments, the command will raise a MATLAB error upon an unsuccessful check-out and else execute silently.

If you execute the command and a license is already checked out then the behavior is the same as the checkout succeeding.

Thanks a lot for the answer of the first part of my question.
Additionally, is there the possiblity to add the path to local a valid license via Matlab console instead of using the License Manager Gui?

PLECS searches certain directories for license files as documented here: https://www.plexim.com/support/installation_help/blockset (section “License File Location”). PLECS does not use activation for licenses.