cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
ih
Super User (Alumni) ih
Super User (Alumni)

Anyone manage add-ins using a script or a centralized tool? Maybe a PowerShell script via Microsoft System Center Configuration Manager (SCCM)?

Is anyone managing add-in installation or updates through scripts or via some central tool?  I do not refer to add-ins updating themselves, rather a tool to ensure that everyone has add-in xyz version 2.0 installed.  I am considering automatically installing and updating a specific list of add-ins via a PowerShell script deployed via SCCM and wondering if anyone is willing to share their experience, advice, or obstacles they encountered.

1 ACCEPTED SOLUTION

Accepted Solutions
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Anyone manage add-ins using a script or a centralized tool? Maybe a PowerShell script via Microsoft System Center Configuration Manager (SCCM)?

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.

View solution in original post

4 REPLIES 4
StarfruitBob
Level VI

Re: Anyone manage add-ins using a script or a centralized tool? Maybe a PowerShell script via Microsoft System Center Configuration Manager (SCCM)?

Hello, @ih.

Could the answer to your question be addressed in this thread?
https://community.jmp.com/t5/JMP-Scripts/How-to-write-self-updating-JMP-add-ins/ta-p/21932/ 

Learning every day!
StarfruitBob
Level VI

Re: Anyone manage add-ins using a script or a centralized tool? Maybe a PowerShell script via Microsoft System Center Configuration Manager (SCCM)?

Never mind, I just re-read your message - sorry!

Learning every day!
jthi
Super User

Re: Anyone manage add-ins using a script or a centralized tool? Maybe a PowerShell script via Microsoft System Center Configuration Manager (SCCM)?

I haven't (yet) pushed any add-ins or custom functions (would most likely also be wrapped in add-in) to users PCs but will most likely do it in future. 

Some possible issues that come to my mind:

  • If users have different versions of JMP in your organization some add-ins might not work
  • Multiple users on the computer
  • Depending how the add-ins will be installed updating all the .xml and so on files so they are visible in menus (I think addinRegistry.xml at least) (is silent installation possible using JMP from comman-dline/powershell?)

Currently I'm sharing add-ins with a JSL script, which will get the add-ins from specific location and user then accepts the installations (add-ins are auto-updating after installation and the same installation jsl can be also used to update them). This currently works for my use-case, but I will also have to figure out to push add-ins at some point, so watching this topic closely for good ideas.

-Jarmo
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Anyone manage add-ins using a script or a centralized tool? Maybe a PowerShell script via Microsoft System Center Configuration Manager (SCCM)?

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.