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

MBS FileMaker Plugin Example Databases

Generate and Verify License Key

All examples are included with download of MBS FileMaker Plugin.

Generate and Verify License Key.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts3
Value Lists0
Custom Functions0
Custom Menus0
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
lic_text
3 fields defined, 1 record
lic_text

Fields

Table Name: lic_text - 3 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
System_IDNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: Minimal
  • Automatically create indexes as needed
  • Index Language: German
the System ID
        entered_LicenseNormal, TextAuto-Enter:
        • Allow editing
        Validation:
        • Only during data entry
        Storage:
        • Repetitions: 1
        • Indexing: None
        • Automatically create indexes as needed
        • Index Language: German
              lic_inputNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Global
              • Repetitions: 1
              • Index Language: German

                    Layout Objects: lic_text

                    Regular Fields

                    Field Name: lic_text::System_ID
                    Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                    • Top: 67 pt
                    • Left: 217 pt
                    • Bottom: 88 pt
                    • Right: 958 pt
                    • Anchoring: Left, Top
                    Field Format:
                    • Edit Box
                    Field Behavior:
                    • Allow field to be entered: In Find mode, In Browse mode
                    • Touch keyboard type: Default for Data Type
                    • Go to next field using: Tab key
                    Yes

                    Field Name: lic_text::entered_License
                    Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                    • Top: 100 pt
                    • Left: 357 pt
                    • Bottom: 121 pt
                    • Right: 958 pt
                    • Anchoring: Left, Top
                    Field Format:
                    • Edit Box
                    Field Behavior:
                    • Allow field to be entered: In Find mode, In Browse mode
                    • Touch keyboard type: Default for Data Type
                    • Go to next field using: Tab key
                    Yes

                    Script Hierarchy

                    Generate License
                    Try License
                    Get System ID

                    Next Script: [Try License]
                    Script NameGenerate License
                    Run script with full access privilegesOff
                    Include In MenuNo
                    Layouts that use this script
                      Scripts that use this script
                      Script Definition
                      Script Steps
                      • #
                      • # get the key
                      • #
                      • Set Variable [ $msy; Value:GetValue ( Get ( ScriptParameter ) ; 1 ) ]
                      • #
                      • # get the system_id
                      • #
                      • Set Variable [ $id; Value:GetValue ( Get ( ScriptParameter ) ; 2 ) ]
                      • #
                      • # crypt the systemid
                      • #
                      • Set Variable [ $part1; Value:MBS( "Encryption.EncryptBlowfish"; $msy; $id ) ]
                      • #
                      • # generate the key
                      • #
                      • Set Variable [ $key; Value:Left ( $part1 ; 5 ) & "-" & Middle ( $part1 ; 6 ; 5 ) & "-" & Middle ( $part1 ; 11 ; 5 ) & "-" & Middle ( $part1 ; 15 ; 5 ) & "-" & Middle ( $part1 ; 20 ; 5 ) ]
                      • Exit Script [ Result: $key ]
                      Fields used in this script
                        Scripts used in this script
                          Layouts used in this script
                            Tables used in this script
                              Table occurrences used by this script
                                Custom Functions used by this script
                                  Custom menu set used by this script

                                    Previous Script: [Generate License]Next Script: [Get System ID]
                                    Script NameTry License
                                    Run script with full access privilegesOff
                                    Include In MenuYes
                                    Layouts that use this script
                                      Scripts that use this script
                                        Script Definition
                                        Script Steps
                                        • #
                                        • # set YOUR secret key here
                                        • #
                                        • Set Variable [ $msy; Value:"sdkw4412ge+00" ]
                                        • #
                                        • # get the systemid
                                        • #
                                        • Perform Script [ “Get System ID” ]
                                        • Set Variable [ $system_id; Value:Get(ScriptResult) ]
                                        • # get the correct key
                                        • #
                                        • Perform Script [ “Generate License”; Parameter: $msy & ¶ & $system_id ]
                                        • Set Variable [ $key; Value:Get(ScriptResult) ]
                                        • #
                                        • # is the system licensed ?
                                        • #
                                        • Set Variable [ $count; Value:ExecuteSQL("SELECT count(*) FROM lic_text WHERE System_ID = ?" ; "" ; "" ; $system_id ) ]
                                        • If [ GetAsNumber($count) = 1 ]
                                        • # system already in the table
                                        • Set Variable [ $saved_key; Value:ExecuteSQL ( "SELECT entered_License FROM lic_text WHERE System_ID = ?" ; "" ; "" ; $system_id ) ]
                                        • Else
                                        • Set Variable [ $r; Value:MBS("FM.ExecuteSQL";"INSERT INTO lic_text (System_ID) Values('" & $system_id & "')") ]
                                        • Set Variable [ $saved_key; Value:"" ]
                                        • End If
                                        • If [ $saved_key = $key ]
                                        • Show Custom Dialog [ Title: "License Check"; Message: "License ok."; Default Button: “OK”, Commit: “Yes” ]
                                        • Else
                                        • Loop
                                        • Show Custom Dialog [ Title: "Invalid License"; Message: "Please enter your License Key" & ¶ & ¶ & "Demo Hint:" & $key; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No”; Input #1: lic_text::lic_input, "License Key" ]
                                        • If [ Get(LastMessageChoice) = 2 ]
                                        • Exit Application
                                        • End If
                                        • If [ lic_text::lic_input ≠ $key ]
                                        • Beep
                                        • Beep
                                        • Else
                                        • Set Variable [ $r; Value:MBS("FM.ExecuteSQL";"UPDATE lic_text SET entered_License = '" & lic_text::lic_input & "'") ]
                                        • Set Field [ lic_text::lic_input; "" ]
                                        • Show Custom Dialog [ Title: "License Check"; Message: "License ok."; Default Button: “OK”, Commit: “Yes” ]
                                        • Exit Script [ ]
                                        • End If
                                        • End Loop
                                        • End If
                                        Fields used in this script
                                        Scripts used in this script
                                        Layouts used in this script
                                          Tables used in this script
                                          Table occurrences used by this script
                                          Custom Functions used by this script
                                            Custom menu set used by this script

                                              Previous Script: [Try License]
                                              Script NameGet System ID
                                              Run script with full access privilegesOff
                                              Include In MenuNo
                                              Layouts that use this script
                                                Scripts that use this script
                                                Script Definition
                                                Script Steps
                                                • #
                                                • # get a unique id of the system
                                                • #
                                                • Set Variable [ $id; Value:If ( Get ( SystemPlatform ) = 1 ; MBS( "SystemInfo.MacUUID" ); If ( Get ( SystemPlatform ) = -2 ; MBS( "SystemInfo.WinProductKey" ) ; MBS( "SystemInfo.MACAddress" ) ) ) ]
                                                • Set Variable [ $id; Value:Substitute ( $id ; "-" ; "" ) ]
                                                • #
                                                • # bring into a "readable" format
                                                • #
                                                • Set Variable [ $systemid; Value:Left ( $id ; 6 ) & "-" & Middle ( $id ; 7 ; 5 ) & "-" & Middle ( $id ; 12 ; 4 ) & "-" & Middle ( $id ; 16 ; 5 ) ]
                                                • Exit Script [ Result: $systemid ]
                                                Fields used in this script
                                                  Scripts used in this script
                                                    Layouts used in this script
                                                      Tables used in this script
                                                        Table occurrences used by this script
                                                          Custom Functions used by this script
                                                            Custom menu set used by this script

                                                              Download example: Generate and Verify License Key

                                                              Used functions: