Thanks for the report
Indeed, we updated the infrastructure and some the API details changed.
For reference, see Downloading extensions for older releases
Waiting we update the documentation and fix the legacy server to support this snippet, when using Slicer 4.13, you could do this:
extensionName = 'SlicerIGT'
em = slicer.app.extensionsManagerModel()
if not em.isExtensionInstalled(extensionName):
extensionMetaData = em.retrieveExtensionMetadataByName(extensionName)
- url = em.serverUrl().toString()+'/download/item/'+extensionMetaData['item_id']
- extensionPackageFilename = slicer.app.temporaryPath+'/'+extensionMetaData['_id']
+ url = em.serverUrl().toString() + '/download?items='+extensionMetaData['_id']
+ extensionPackageFilename = slicer.app.temporaryPath+'/'+extensionMetaData['_id']
slicer.util.downloadFile(url, extensionPackageFilename)
em.installExtension(extensionPackageFilename)
slicer.util.restart()
For convenience, here is the full snippet for easy copy-paste:
extensionName = 'SlicerIGT'
em = slicer.app.extensionsManagerModel()
if not em.isExtensionInstalled(extensionName):
extensionMetaData = em.retrieveExtensionMetadataByName(extensionName)
url = em.serverUrl().toString() + '/download?items='+extensionMetaData['_id']
extensionPackageFilename = slicer.app.temporaryPath+'/'+extensionMetaData['_id']
slicer.util.downloadFile(url, extensionPackageFilename)
em.installExtension(extensionPackageFilename)
slicer.util.restart()