GateNLP / gate-core

The GATE Embedded core API and GATE Developer application
GNU Lesser General Public License v3.0
76 stars 29 forks source link

GATE Developer installer does not create .desktop files on Linux #51

Closed donpellegrino closed 5 years ago

donpellegrino commented 6 years ago

When running the gate-developer-8.5.1-installer.jar the following was output to the terminal:

$ sudo java -jar gate-developer-8.5.1-installer.jar 
[sudo] password for pellegrinoda: 
Command line arguments: 
Cannot find named resource: 'packsLang.xml' AND 'packsLang.xml_eng'
====================
Installation started
Framework: 5.1.3-SNAPSHOT-ab376 (IzPack)
Platform: linux,version=4.17.1-1.el7.elrepo.x86_64,arch=x64,symbolicName=null,javaVersion=1.8.0_171
Installation finished
WARNING: using deprecated Desktop Entry key Encoding with value UTF-8
WARNING: using deprecated Desktop Entry key Encoding with value UTF-8
WARNING: Shortcut 'GATE 8.5.1 User Guide' has URL but type ('Application') is not 'Link'
WARNING: using deprecated Desktop Entry key Encoding with value UTF-8
WARNING: Could not copy  to /root/.local/share/pixmaps (Source '' does not exist)
[ Writing the uninstaller data ... ]

During the install, I had selected the option to install a desktop shortcut for all users. However, post-installation I am unable to find any gate ".desktop" files and there is no shortcut in GNOME. I am assuming the installer was making reference to GNOME .desktop files used for its launchers.

For reference, the Desktop Entry Specification can be found at https://developer.gnome.org/desktop-entry-spec/.

As a work-around I placed the following into a ~/.local/share/applications/gate.desktop file:

[Desktop Entry]
Name=GATE Developer
Exec=/opt/GATE_Developer_8.5.1/bin/gate.sh
Icon=/opt/GATE_Developer_8.5.1/icons/gate-icon.png
Type=Application
Terminal=false

In addition, the gate-icon.png has "8.1" drawn in the lower-right corner, which does not match the version of "8.5.1."

greenwoodma commented 6 years ago

Wow, I can't believe we've missed updating that icon since 8.1. Thanks, we'll add it to the list of release tasks so it gets updated in the future.

For reference within the source repo it's at distro/build/deploy/gate-icon.png

ianroberts commented 6 years ago

dbfa00773ca6720404f3a4e5bb49b573220c6794 adds a target to the build.xml to rebuild that file from GATEVersion.svg

greenwoodma commented 6 years ago

Does that mean we need to make sure the right fonts are installed on gs2 so that it gets converted correctly due the nightlies or is it a target you have to run manually?

greenwoodma commented 6 years ago

Not sure why I didn't just check myself; it's a manual step

ianroberts commented 6 years ago

Yeah, same as svg2java

greenwoodma commented 5 years ago

I've just checked and I can reproduce the main issue in this report. If I install GATE using sudo then the option to add the shortcuts for all users does indeed appear to do nothing. In fact running under sudo and installing shortcuts only for the current user also does nothing. Running without sudo and the only option available, add shortcuts for current user, does actually work. This suggests there is something odd going on when running under sudo. Not sure if this is a bug in our config of IzPack or a problem with IzPack itself. Will investigate further

greenwoodma commented 5 years ago

Ah. It appears that when run as sudo it puts the *.desktop files under /root/.local/share which would man they would only be used by root. Looking at the log file you can see this in more detail

/root/.local/share/pixmaps/gate-icon.png
/root/.local/share/applications/GATE Developer 8.6-SNAPSHOT.desktop
/root/.local/share/pixmaps/mime-application-pdf.png
/root/.local/share/applications/GATE 8.6-SNAPSHOT User Guide.desktop
/root/.local/share/applications/Uninstall GATE Developer 8.6-SNAPSHOT.desktop
/etc/xdg/menus/applications-merged/GATE Developer 8.6-SNAPSHOT.menu
/etc/xdg/menus/applications-gnome-merged/GATE Developer 8.6-SNAPSHOT.menu
/usr/share/desktop-directories/GATE-Developer-8.6-SNAPSHOT-izpack.directory

I'm guessing the *.menu and *.directory files are for other window managers so this may just be a Unity issue.

greenwoodma commented 5 years ago

There is a createForAll option which seems to need setting for this to work. Once set it appears that things are installed in the correct place under all three options. Specifically if you install using sudo and then install the shortcuts for all users the files are copied to the following locations

/usr/share/pixmaps/gate-icon.png
/usr/share/applications/GATE Developer 8.6-SNAPSHOT.desktop
/usr/share/pixmaps/mime-application-pdf.png
/usr/share/applications/GATE 8.6-SNAPSHOT User Guide.desktop
/usr/share/applications/Uninstall GATE Developer 8.6-SNAPSHOT.desktop
/etc/xdg/menus/applications-merged/GATE Developer 8.6-SNAPSHOT.menu
/etc/xdg/menus/applications-gnome-merged/GATE Developer 8.6-SNAPSHOT.menu
/usr/share/desktop-directories/GATE-Developer-8.6-SNAPSHOT-izpack.directory

which as far as I can tell are correct and seem to work.

Commit 1882a2a should close this issue.