I finally got around to working on this. As described in the Adding Custom Files to a Software Depot section of the deployment guide, the ProgramData folder makes automating these pretty easy as every time JMP launches it looks in those folders. (Thank you @Bobby_Riggs for pointed me to that folder.) Thus, a PowerShell script just needs to update those folders to install add-ins and set default user preferences.
Here is a draft script that installs add-ins, installs the license file, and then sets the location of the license file in user preferences:
# Instructions:
# Load add-ins and license files to the location spcified with SourceDir below.
#
# These files should be in that directory:
# JMPOSIPITools.jmpaddin
# JMPScriptingTools v1.16.jmpaddin
# JMPValidation.jmpaddin
# JMP.PER
#
# The jmp.per file can be copied from another installation, or created using the license update tool that is installed with JMP.
# Run this script in powershell
#Set location where add-ins and the license file are available, can be a network drive
$SourceDir = "C:\Temp\JMPInstallSource"
# JMP Install Directory
$InstallDir = "C:\Program Files\SAS\JMPPRO\17"
#Load the License File
$LicenseFile = $InstallDir+"\jmp.per"
Copy-Item $SourceDir"\jmp.per" $LicenseFile -Force
# Create directories if needed
New-Item -Path $Env:ALLUSERSPROFILE"/SAS" -ItemType Directory -Force
New-Item -Path $Env:ALLUSERSPROFILE"/SAS/JMPPRO" -ItemType Directory -Force
New-Item -Path $Env:ALLUSERSPROFILE"/SAS/JMPPRO/17" -ItemType Directory -Force
$AddinDir = $Env:ALLUSERSPROFILE+"/SAS/JMPPRO/addins"
New-Item -Path $AddinDir -ItemType Directory -Force
# Create preferences file that links to the license file
$fn = $Env:ALLUSERSPROFILE+"/SAS/JMPPRO/17/JMP.PFS"
New-Item -Force $fn
Set-Content $fn "Preferences(
File Location Settings(
License File Path( $LicenseFile )
)
);"
#procedure to unzip an add-in and load it in the shared folder
function LoadAddin {
param(
$name
)
Copy-Item $SourceDir"\"$name".jmpaddin" $Env:temp"\"$name".zip" -Force
New-Item -Path $AddinDir"\"$name"" -ItemType Directory -Force
Expand-Archive $Env:temp"\"$name".zip" -DestinationPath $AddinDir"\"$name"" -Force
}
#Load each add-in
LoadAddin("JMPOSIPITOOLS")
LoadAddin("JMPScriptingTools v1.16")
LoadAddin("JMPValidation")
Note that in my case I also wanted to set default user preferences for those add-ins, I am doing that with a powershell script that runs at login. If I need to remove an add-in entirely I would do that in this script as well.