Create Gnome/Ubuntu desktop files under with Eclipse Oomph installer

If you are a user of the Eclipse IDE using Ubuntu and you are using the Oomph installer as well, I will show the possibility to automatically create .desktop files. That makes it possible to find the installation with your desktop search tool. I used it for a while and it works under Ubuntu 16.04, 17.10 and now under 18.04.

You can make use of the ResourceCreationTask in Oomph. To get a nicer name for the installation name, that can be found in your Ubuntu, I just added a VariableTask:

<setupTask
      xsi:type="setup:VariableTask"
      name="installation.name"
      label="Installation Name"/>

Now you can define any name you want in your setup. You can later search for this application name.

img

Now just add a further ResourceCreationTask:

<setupTask
      xsi:type="setup:ResourceCreationTask"
      id="photon.gnome.desktop"
      content="[Desktop Entry]
               Encoding=UTF-8
               Version=Photon
               Type=Application
               Name=${installation.name}
               Terminal=false
               Icon=${installation.location}/eclipse/icon.xpm
               Path=${installation.location}/eclipse
               Exec=env UBUNTU_MENUPROXY=0 SWT_GTK3=0 GDK_DPI_SCALE=1.5${installation.location}/eclipse/eclipse -data ${installation.location}/workspace -clean
               Categories=Application;Development;IDE;"
       targetURL="${user.home}/.local/share/applications/${installation.name}.desktop"/>

Just modify the content of this file, as you need it. Now you can search for your application.

img

Have fun!

by Ilenia Salvadori, Mark Hoffmann, Jürgen Albert