Programmatically download latest version
Answered
Hey all,
Im trying to create a script to download the latest version of Intellij and do some setup to make onboarding a bit easier. However I have yet to figure out how to fetch the latest version using command line tools. The only way I have figured out how to this is using phantomJs to render the download page to get the link (using curl returns an empty href so some javascript is responsible for populating the url).
Anyway using phantomJs to get the latest link is a bit of a hack. Is there currently any better way to do this?
Please sign in to leave a comment.
I use a curl one-liner to update PhpStorm on Ubuntu ;)
You can try parsing https://www.jetbrains.com/updates/updates.xml for IDEA_Release channel to get the latest version string, then construct the download link for your platform once you know the latest release version number:
K Zhong Please try this direct download link:
https://download.jetbrains.com/product?code=PS&platform=linuxARM64
Hello,
Available options are:
linux
linuxARM64
mac
macM1
windows
windowsARM64
windowsZip
Ahh!! That xml file is exactly what I was looking for!
Thank you!
Serge,
Just ran into an issue with the latest critical patch where the download link is not the version number but has an 'b' appended onto the end. Is this a bug with updates.xml or how should our code handle this one off situation?
Thanks in advance.
Hi Brian,
actually updates.xml file is designed to be used by our IDEs while performing 'Check for Updates' action. 'version' attribute is used just for presentation, its value is shown in the 'Platform and Plugin Updates' dialog. So it isn't guarantied that this value directly corresponds to the download URLs. 2016.1.2b was a hotfix update and we didn't want to change version name for it. For now you can either add an exception for 2016.1.2 or wait for 2016.1.3 which will be released very soon.
Unfortunately currently there is no reliable way to get the latest version of the IDE programmatically. The URLs provided by Serge aren't quite correct, we started bundling our custom JDK by default with Mac OS X distribution, so there are no '-custom-jdk-bundled.dmg' artifact anymore. Though we plan to fix this problem by providing a reliable way to get download URLs for different versions.
Thanks Nikolay!
I'd also like to prgrammatically determine the latest version of IDEA, but the linked updates.xml does not seem to contain updates for IDEA anymore. Is that somewhere else now?
It does:
<channel id="IDEA_Release" name="IntelliJ IDEA Release" status="release" url="https://www.jetbrains.com/idea/download" feedback="https://youtrack.jetbrains.com" majorVersion="2018" licensing="release">
<build number="181.5540" version="2018.1.6" releaseDate="20180327" fullNumber="181.5540.7">
oh indeed - why is the order so incredibly random though?
To figure out the latest version of IDEA I apparently have to fetch all versions and then compare them to find the greatest one. oof.
EDIT: This looks a lot better: https://data.services.jetbrains.com/products/releases?code=IIC
Just for future reference. This is the script I use to get me the latest version and return the file to download.
This at has been working for me for the past few years. Hopefully it can help someone else.
Philipp ‘s answer is very useful to me. However, how do you specify the arch in that url? For example, I’d like to download a linux aarch64 tar ball.
Jacky Liu Thanks for your comment. Is there a list of valid values for the variable `platform`?
How do I find the intellijIdea Product code to use with Phillip code?
Alexandre What is Phillip code?
This one https://intellij-support.jetbrains.com/hc/en-us/community/posts/207155515/comments/360000261479
Alexandre Please check here: