Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

Home | Scripts | Examples | Functions | Recent Updates | Tutorials | Resources | Publications | Consulting | Projects | Contact & Bio |PyJEM| Search

 

Protecting Scripts
Function
Function to read the Gatan license information. This might be used to protect a script or package of scripts.
Version
version:20140511, v1.0
Author
D. R. G. Mitchell
Acknowledgements
-
Comments

Function to read the Gatan license information. This might be used to protect a script or package of scripts. The function could be installed either within the script it is protecting or as a library if it were to protect several scripts. Either way, scripts and library files would need to saved into a package in order to conceal the source code. This implementation is very flimsy, since it expects license files to be in a specific place - potentially this could vary between Windows XP and 7 and with the type of installation. This script is not supported, as I encourage non-commercial developers to share their code - not protect it. Is included for demonstration purposes only.

System Requirements
Tested on GMS 2.3
Known Issues

Function to return the Site ID license code which is sourced from the text file found in the Licenses folder at C:\Documents and Settings\All Users\Application Data\Gatan\Licenses\**** where **** is the name of the license file. I have tested this on a free version of DM in which the file name is: "GATAN_FREE Offline 32-Bit Suites.txt". I have not tested this on a proper DM version where the file will be called something else. The name of this text file must be hardcoded into the 'licensename' variable - which appears at the start of the function. If the file is not found or there is some kind of error, then the license name is 'Error'.

Supported
No.
Included Files
Single script file.
Source Code

See attached script file.