Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Register

This function is used to register the Plugin.

Component Version macOS Windows Linux Server iOS SDK
Plugin 1.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Register"; Licensee Name; Component; License Type; Expire Month; Serial number )   More

Parameters

Parameter Description Example
Licensee Name This is the name of the person or organization that holds the license for the plug-in Your Name
Component The component that was licensed. For example "Complete"
License Type Seats purchased. For example, "1 seat", "10 seats", "Developer" 1 Seat
Expire Month This is the month in which the serial will expire for new versions of the plug-in in YYYYMM format. Plug-in released before the end of that month will continue to work forever. New Releases after that date will require a renewal 200708
Serial number The license number your serial number

Result

Returns OK on success.

Description

This function is used to register the Plugin.
If you use Server and Client licenses, be sure to register the right license for the right type.
e.g. in your script detect if you are on the server or not.
Before you register, you may want to check if already is registered.

See also StoreRegistration, IsRegistration, IsRuntime, IsServer and IsClient functions.

Newer plugins since 8.4 call StoreRegistration for iOS and Server automatically, so plugin registers automatically on loading and avoid problems with process is relaunched.

Examples

Register only when needed:

If [MBS("IsRegistered") ≠1]
    If [MBS("IsRuntime")]
        Set Variable [$r; Value:MBS("Register"; "test"; "Runtime"; 123; 123)]
    Else If [MBS("IsMobile")]
        Set Variable [$r; Value:MBS("Register"; "test"; "iOS"; 123; 123)]
    Else If [MBS("IsServer")]
        Set Variable [$r; Value:MBS("Register"; "test"; "Server"; 123; 123)]
    Else
        Set Variable [$r; Value:MBS("Register"; "test"; "5 seats"; 123; 123)]
    End If
End If

Register with license values in a text field:

Set Variable [ $result ; Value: Evaluate("MBS(\"Register\"; " & Register::License & ")") ]

Register with Startup script for server and client:

Startup Script:

#Register for client
Perform Script [“InitMBS”]
#Register for server. Will be ignored if no server or no plugin installed on server
Perform Script on Server [“InitMBS”]


InitMBS script:

#Enable debug logging. Shows messages in DebugView/Console.app
Set Variable [$r; Value:MBS("Trace")]
#Register if needed for right platform
If [MBS("IsRegistered") = 0]
    If [MBS("IsRuntime")]
        Set Variable [$r; Value:MBS("Register"; "test"; "Complete"; "Runtime"; 123; 123)]
    Else If [MBS("IsServer")]
        Set Variable [$r; Value:MBS("Register"; "test"; "Complete"; "Server"; 123; 123)]
    Else If [MBS("IsClient")]
        Set Variable [$r; Value:MBS("Register"; "test"; "Complete"; "5 Seats"; 123; 123)]
    Else
        Set Variable [$r; Value:"Unknown platform: " & MBS("Platform")]
    End If
    #Show errors, so developer can fix them
    If [$r ≠ "OK"]
        Show Custom Dialog ["InitMBS failed."; $r]
    End If
End If
#May initialize other stuff
#like dynapdf with library in extensions folder
If [MBS("DynaPDF.IsInitialized") = 0]
    Set Variable [$DynaPDFLicense; Value:"1003637-16022016-3-8-12-685C57F..."]
    If [MBS("IsWindows")]
        Set Variable [$r; Value:MBS( "DynaPDF.Initialize"; "dynapdf.dll"; $DynaPDFLicense)]
    Else If [MBS("IsMacOSX")]
        Set Variable [$r; Value:MBS( "DynaPDF.Initialize"; "dynapdf.dylib"; $DynaPDFLicense)]
    Else
        Set Variable [$r; Value:"Unknown platform: " & MBS("Platform")]
    End If
    #Show errors, so developer can fix them
    If [$r ≠ "OK"]
        Show Custom Dialog ["InitMBS failed."; $r]
    End If
End If

See also

Blog Entries

This function is free to use.

Created 18th August 2014, last changed 21st January 2022


RegEx.Version - Registration