How could we install zpm?
Hello,
We have read the installation guide to get started with zpm package manager:
https://openexchange.intersystems.com/package/ObjectScript-Package-Manag...
We wonder what means the second step:
"Import the zpm.xml into IRIS and compile via any desired way (Management Portal, Studio or Terminal)"
We have thought that it means to place the zpm-0.2.2.xml file inside "C:\InterSystems\HealthShare_2\opt\contenedor"
Then in the terminal, go inside one namespace:
zn "esbsscc"
After that we load and compile the .xml:
write $SYSTEM.OBJ.Load("C:\InterSystems\HealthShare_2\opt\contenedor\zpm-0.2.2.xml")
The terminal outputs:
Loading file C:\InterSystems\HealthShare_2\opt\contenedor\zpm-0.2.2.xml as xml
Imported class: %ZPM.Installer
Load finished successfully.
1
However, when we try to verify that it is installed:
zpm
ZPM
^
<SYNTAX>
What are the steps to install zpm package manager?
We have also read:
https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?K...
https://github.com/intersystems-community/zpm/wiki
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...
Hi Yone!
The steps are good, but it is only for IRIS and IRIS for Health.
You need the c flag
write $SYSTEM.OBJ.Load("C:\InterSystems\HealthShare_2\opt\contenedor\zpm-0.2.2.xml", "c")
But as @Evgeny Shvarov said you'll need InterSystems IRIS for zpm to work.
BTW, there is a very good one-liner to install ZPM, cortesy of @Guillaume Rongier:
set $namespace="%SYS", name="DefaultSSL" do:'##class(Security.SSLConfigs).Exists(name) ##class(Security.SSLConfigs).Create(name) set url="https://pm.community.intersystems.com/packages/zpm/latest/installer" Do ##class(%Net.URLParser).Parse(url,.comp) set ht = ##class(%Net.HttpRequest).%New(), ht.Server = comp("host"), ht.Port = 443, ht.Https=1, ht.SSLConfiguration=name, st=ht.Get(comp("path")) if 'st { w $System.Status.GetErrorText(st) q } set xml=##class(%File).TempFilename("xml"), tFile = ##class(%Stream.FileBinary).%New(), tFile.Filename = xml do tFile.CopyFromAndSave(ht.HttpResponse.Data) do ht.%Close(), $system.OBJ.Load(xml,"ck") do ##class(%File).Delete(xml)
There is a shorter line, from @Sergei Shutov
zn "%SYS" d ##class(Security.SSLConfigs).Create("z") s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="z" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")
Even better! Thanks @Sergey Mikhailenko
219 characters:
s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")
Nice! Stolen for one-liners)