Skip to content

Commit

Permalink
Create and add PsychLicenseHandling(): License management.
Browse files Browse the repository at this point in the history
PsychLicenseHandling() is called by PsychtoolboxPostInstallRoutine
to guide the user of a new installation of Psychtoolbox 3.0.20 and later
through software license management setup on first use of such a PTB
version on a machine's user account. This on PTB variants that require a
paid software license to work.

During first time setup, it also informs the user about the purpose and
scope of license management, the general type of data collected and
transmitted to the license servers of our network licensing provider,
and where to find more detailed information and contact addresses wrt.
our data protection policies, etc. If the user feels sufficiently informed
and gives it a go, it enables network license management for that specific
user account and then makes first contact to the license servers, sending
initial data to the servers for enabling licensing. This includes enabling
the use of time-limited free trial versions.

After initial setup, it provides user callable functions to manage the
license on that user account + operating system + machine combination,
e.g., activating or deactivating or reactivating a license instance on a
OS + machine combo, checking licensing status, refreshing activation
info if needed. It also can generate new-style support authentication
tokens for licensed users, directly or when called by the support function
PsychPaidSupportAndServices().

This code has been implemented, merged, and is currently used to
implement software licensing of Psychtoolbox on behalf of Psychtoolbox
commercial host company, the Medical Innovations Incubator GmbH, in
Tübingen, Germany, under authorization and management by the
companies CEO Ingo Hämmerle.

Website: https://psychtoolbox.net

Any questions or requests wrt. the software licensing, data protection
policies and measures should be directed to them under the following
current address, as of November 2024:

Medical Innovations Incubator GmbH
Eisenbahnstr. 63
72070 Tübingen
Germany

Commercial register: HRB 751684
Register court: Local court Stuttgart, Germany
Contact E-Mail address for inquiries: [email protected]

The actual software implementation work is done by Mario Kleiner under
employment by the Medical Innovations Incubator GmbH, as of November
2024.

Signed-off-by: Mario Kleiner <[email protected]>
  • Loading branch information
Mario Kleiner authored and kleinerm committed Nov 24, 2024
1 parent c4477f1 commit 79607c8
Show file tree
Hide file tree
Showing 3 changed files with 474 additions and 40 deletions.
26 changes: 22 additions & 4 deletions Psychtoolbox/PsychDocumentation/PsychPaidSupportAndServices.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
function PsychPaidSupportAndServices(mininag)
%
% If you require paid support regarding Psychtoolbox, or custom feature
% If you are using a Psychtoolbox variant and version that requires a paid
% software license key to function, e.g., on Microsoft Windows or Apple
% macOS, then a few minutes of basic support per year for basic questions
% may be included in the specific type of software license you bought. If,
% when, and how much support will be provided is usually at the discretion
% of the Psychtoolbox team. In any case, if you wanted to ask for this
% basic support, you'd have to present an authentication token by running
% this function, or by calling PsychLicenseHandling('AuthenticationToken').
%
% If you require additional paid support regarding Psychtoolbox, or custom feature
% development (or if you want to buy a Psychtoolbox themed coffee mug, bag or shirt)
% go to the following website which provides such services:
%
Expand Down Expand Up @@ -131,9 +140,18 @@ function PsychPaidSupportAndServices(mininag)
% Check if user wants to file a support request:
fprintf('\n\n');

try
fprintf('Checking if this machine has a valid Psychtoolbox software license activated...\n');
PsychLicenseHandling('AuthenticationToken');
fprintf('If an authentication token was printed, you may be able to get a few minutes of free support.\n');
fprintf('This would spare you from paying for additional paid support. Worth a try...\n');
catch
fprintf('Nope. No valid and active Psychtoolbox software license detected. That leaves the paid option...\n');
end

answer = '';
while length(answer)~=1 || ~ismember(answer, ['y', 'n'])
answer = strtrim(input('Do you need paid support now and have an active license key [y/n]? ', 's'));
answer = strtrim(input('Do you need additional paid support now and have an active support license key [y/n]? ', 's'));
end

if ~strcmpi(answer, 'y')
Expand Down Expand Up @@ -164,7 +182,7 @@ function PsychPaidSupportAndServices(mininag)
end

% Get the date and time string as 2nd component:
requestTimeDate = sprintf('%i', round(clock));
requestTimeDate = sprintf('%i', round(clock)); %#ok<CLOCK>

licenseKey = '';
while isempty(licenseKey)
Expand Down Expand Up @@ -204,7 +222,7 @@ function PsychPaidSupportAndServices(mininag)
% Validation code for the above:
if 0
% Disassemble into pieces:
eOrderId = authToken(1:8)
eOrderId = authToken(1:8) %#ok<*UNRCH>
epublicStringHashSep = strfind(authToken, ':');
epublicString = authToken(1:epublicStringHashSep-1)
ehashString = authToken(epublicStringHashSep+1:end)
Expand Down
Loading

0 comments on commit 79607c8

Please sign in to comment.