Setting up an ‘Add-in Depot’ makes it easy to administer a collection of self-updating JMP add-ins. In this example, the Depot is nothing more than a folder containing:
In a typical case, the add-in depot will reside on a server folder where add-in users have read access.The metadata file is a JMP table that stores information about each add-in in the depot. In this example, we will use it to check when the add-in was most recently published.If the add-in is current when the user runs it, the add-in will run without fanfare. However, if the user attempts to run an outdated version of the add-in, he or she will receive a prompt to install the new version:If the user clicks “Cancel”, the present addin will run. If he or she clicks “OK” the update will install automatically, overwriting the outdated version. In this example, the user is informed of the install and prompted to re-run the addin:
Self-updating JMP add-ins: a step-by-step example.
Note that we have not yet published the add-in, as we have yet to change the publish date in the metadata file. To see this, from the JMP menu select Add-Ins >> Hello World (or whatever you entered as the menu item text) and the “Hello World” window will appear as before.
Hi, this sounds very useful. Unfortunately it didn´t work for me (it was all fine until the last point f.).
Is it possible that something (Root? Folder?) in the "File Metadata.jmp" has to be changed?
Edit:
There was a naming issue in my case. I was able to fix the issue by setting the following names identical:
- Add-In Name
- Add-In ID
- File in "File Metadata.jmp"
- the filename of the jmpaddin
I named all these: "Foo.jmpaddin"
Now it works like a charme!
Hi Jeff,
This works really nice for controlling add-ins with a group or Team .
I have a small problem with it, when I do the update as from your instructions I always get this message.
"Update Version is still available"
When I click OK the install happens, but the next time again the message appears.
I believe it has something to do with the different time Zones, I am in the UK.
I have updated the time Zone in the metafile "Publish Date" to d/m/y.
I have updated the start of the script line 10 "in format" to dd/mm/yyyy.
Does anything need updated in the "Update function" file ?
Any help appreciated.
@ivan_j_moore I had the same issue (international company) so I switched to using the add-in version number instead of the date. So basically:
// Get the installed JMP AddIn version
installedAddIn = Get Addin( "com.jmp.brady.addin1.jmpaddin" );
installedAddInVer = installedAddIn << version;
addinLocation = "http://gitlab.contoso.com/addin/updateLocation/addin1.jmpaddin";
depot_path = "http://gitlab.contoso.com/addin/updateLocation/";
meta_file = "File Metadata.csv";
Try(
dtm = Open( depot_path || meta_file, invisible );
r = ((dtm << selectwhere( :File == "addin1.jmpaddin" )) << get selected rows)[1];
mostrecent = Column( dtm, "Version" )[r];,
print("Cannot access update site.");
mostrecent = installedAddInVer;
Throw("AddIn cannot check for updates.");
);
If( mostrecent != installedAddInVer,
requestUpdate( mostrecent, installedAddInVer, addinLocation);
);
Close( dtm, nosave );
The tradeoff (I guess you could call it that?) is that the version number in the AddIn and the version column (in place of the date column) in File Metadata have to be the same for each new version, but that's not that big a deal (still have to update the date anyway). I also switched to .csv for File Metadata because I have a Python script that builds JMP add-ins and Python can't write .jmp files. I really ought to make a post about that script...