Skip to Content
Technical Articles
Author's profile photo Stefan Schnell

Out Now Tip: Automatically Check Update Availability of SAP Dev Tools for Eclipse with PowerShell

In the context of the upgrade to Eclipse Mars release moves the question “How do we know when an update is available?” in the foucus. Sure, on the one hand you can use Check for Updates item from Help menu in Eclipse, but for an administrator is it rather unusual to start an development environment like Eclipse. On the other hand you can use a script to check the availability of an update. Here is an example in PowerShell 5 which checks the artifacts and content XML files from If differences are found between the previous and current download it opens a messagebox or alternatively it sends an e-mail. You can execute this script automatically e.g. at fixed time a day and if an update is available it informs you, otherwise nothing happens.

I think it is not difficult to transpose this script in other script languages.

#- PowerShell script to check the availabilty of SAP Development Tools
#- for Eclipse updates based on the changes of artifacts.xml and
#- content.xml from
#- Language: PowerShell 5
#- Author:   Stefan Schnell

  #-Sub EclUpdateAvailable----------------------------------------------
  #- Parameter $EclRel is the Eclipse releae, e.g. like mars or neon
    Function EclUpdateAvailable($EclRel) {

      #-Set Date and Time variable for Timestamp------------------------
        $date = Get-Date -Format "yyyMMdd"
        $time = Get-Date -Format "HHmmss"
        $stamp = "_" + $date + "_" + $time

      #-Get the last files----------------------------------------------
        $artifactsLastFile = dir artifacts*.xml | Sort -Descending | `
          Select -First 1
        $contentLastFile = dir content*.xml | Sort -Descending | `
          Select -First 1

      #-Download artifacts.jar, expand and rename artifacts.xml---------
        $url = "" + $EclRel + `
        $artifacts_zip = $PSScriptRoot + "\artifacts" + $stamp + ".zip"
        Invoke-WebRequest -Uri $url -OutFile $artifacts_zip
        Expand-Archive -Path $artifacts_zip `
          -DestinationPath $PSScriptRoot -Force
        Remove-Item $artifacts_zip
        $artifacts_xml = $PSScriptRoot + "\artifacts.xml"
        $artifacts_new = $PSScriptRoot + "\artifacts" + $stamp + ".xml"
        Rename-Item -Path $artifacts_xml -NewName $artifacts_new

      #-Download content.jar, expand and rename content.xml-------------
        $url = "" + $EclRel + `
        $content_zip = $PSScriptRoot + "\content" + $stamp + ".zip"
        Invoke-WebRequest -Uri $url -OutFile $content_zip
        Expand-Archive -Path $content_zip `
          -DestinationPath $PSScriptRoot -Force
        Remove-Item $content_zip
        $content_xml = $PSScriptRoot + "\content.xml"
        $content_new = $PSScriptRoot + "\content" + $stamp + ".xml"
        Rename-Item -Path $content_xml -NewName $content_new

      #-Compare artifacts.xml-------------------------------------------
        $artiRes = $false
        If ($artifactsLastFile) {
          If (((Get-FileHash $artifactsLastFile).hash) -ne `
            ((Get-FileHash $artifacts_new).hash)) {
            $artiRes = $true

      #-Compare content.xml---------------------------------------------
        $contRes = $false
        If ($contentLastFile) {
          If (((Get-FileHash $contentLastFile).hash) -ne `
            ((Get-FileHash $content_new).hash)) {
            $contRes = $true

      #-If artifacts.xml or content.xml have changed--------------------
        If ($artiRes -or $contRes) {
          #-Show messagebox---------------------------------------------
            $rc = [System.Windows.Forms.MessageBox]::Show( `
              "An SAP Development Tools for Eclipse update is available", `
              "Important hint", 0)
          #-Send email--------------------------------------------------
#            $outlook = New-Object -ComObject Outlook.Application
#            $mail = $outlook.CreateItem(0)
#            $mail.To = ""
#            $mail.Subject = "SAP Development Tools for Eclipse"
#            $mail.Body = "An SAP Development Tools for Eclipse " + `
#              "update is available"
#            $mail.Send()


  #-Sub Main------------------------------------------------------------
    Function Main() {
      EclUpdateAvailable "mars"

    If ($PSVersionTable.PSVersion.Major -ge 5) {


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Łukasz Pęgiel
      Łukasz Pęgiel

      Hello Stefan,

      nice one, but there is automatic check of updates in Eclipse and it does not require admin rights to do it as it's only simple download and extract of packages. So what for to play with PowerShell ?




      Author's profile photo Stefan Schnell
      Stefan Schnell
      Blog Post Author

      Hello Lukasz,

      thanks for this cool tip.

      As you can imagine I don't know this way - but now  🙂



      Author's profile photo Łukasz Pęgiel
      Łukasz Pęgiel

      That's what I thought. Funny fact is that I often do same stuff, means I don't know about built-in feature / class / FM so I create the feature by myself. Then once I've done it someone tells me that it was really good, unnecessary work 🙂