Launch Logger JMP Add-In, Version 1
Written by Jeff Perkinson, jeff.Perkinson@jmp.com
Launch Logger creates a small text file containing system details each time JMP is launched.
These text files can be used to track how many times JMP is launched on a given machine.
If a system administrator gathers all of these files across a collection of machines the administrator can track JMP launches across an organization.
Launch Logger has no user interface. It uses addinload.jsl to gather system information and write it to the text file.
The text file is stored in the directory defined by the JMP Path Variable USER_APPDATA. The location pointed to by this variable depends on the JMP Product and operating system.
- Windows (JMP): C:/Users/<username>/AppData/Roaming/SAS/JMP/<version number>/
- Windows (JMP Pro): C:/Users/<username>/AppData/Roaming/SAS/JMPPro/<version number>/
- Macintosh: /Users/<username>/Library/Application Support/JMP/<version number>/
The files in this directory are named using the pattern:
hostname_date_time.txt
where hostname is the name of the machine running JMP and date and time are the launch date and time.
The information collected in the text files is:
Bitness => 64-bit or 32-bit
Build Information => the build date and time, whether it’s a release or debug build, and the product name in a comma-delimited string
Date => the date and time that JMP is being launched
Host => Mac or Windows
Hostname => the value of the environment variable COMPUTERNAME (Windows) or HOSTNAME (Mac)
JMP Version => the version of JMP being launched
Product Name => the name of the JMP product being run, Pro or Standard
Username => the value of the environment variable USERNAME (Windows) or USER (Macintosh)
The text file is written using a syntax that makes it easy to read these values back into an associative array in JMP for aggregating the logs.
The contents of addinload.jsl in Launch Logger are:
info = Associative Array();
info["JMP Version"] = JMP Version();
info["Build Information"] = Build Information();
info["Date"] = Format( Today(), "m/d/y h:m:s" );
info["Host"] = If( Host is( Mac ),
"Mac",
"Windows"
);
info["Bitness"] = If( Host is( Bits32 ),
"32-bit",
"64-bit"
);
info["Username"] = If( Host is( Windows ),
Get Environment Variable( "USERNAME" ),
Get Environment Variable( "USER" )
);
info["Product Name"] = JMP Product Name();
info["Hostname"] = If( Host is( Windows ),
Get Environment Variable( "COMPUTERNAME" ),
Get Environment Variable( "HOSTNAME" )
);
dir = "$USER_APPDATA/JMPLaunchLogger/";
filename = dir || info["Hostname"] || "_" || Format( Today(), "ddMONYYYY" ) || "_" || Char( Hour( Today() ) ) || Char( Minute( Today() ) ) ||
Char( Second( Today() ) ) || ".txt";
If( !Directory Exists( dir ),
dir_create_success = Try( Create Directory( dir ), exception_msg )
);
Save Text File( filename, Char( info ) );