How to define that RPM package has a GUI in install4j?

244 Views Asked by At

I'm using install4j and I'd like to know how I can specify that the software package has a GUI. I'm testing this with Mageia and there the packages are grouped as those with a GUI and those without a GUI. After installing my package it's in the list of packages without a GUI. But it's a Java desktop application with a GUI. Mageia shows those with a GUI by default so my package is hard to find.

Those without a GUI are mostly libraries which get installed as dependencies of other packages. The user usually only installs software with a GUI.

2

There are 2 best solutions below

2
On

On Installer->Screens & Actions, you can add an empty custom application whose "Default execution mode" property is set to "Unattended mode" and then add a single "Add a desktop link" action for your launcher to the "Startup" node.

In the media wizard of your RPM archive, on the "Installer options->Post install script" step, you can then call that executable.

0
On

For now I use this (for debian too):

Post Install:

#!/bin/bash

echo "Categories=Office;" >> XXXXX.desktop
if [ -x "$(command -v desktop-file-install)" ]; then
  desktop-file-install XXXXX.desktop
fi
if [ -x "$(command -v xdg-desktop-menu)" ]; then
  xdg-desktop-menu install --novendor XXXXX.desktop
fi

exit 0

Post Uninstall:

#!/bin/bash

if [ -f /usr/share/applications/XXXXX.desktop ]; then
  if [ -x "$(command -v xdg-desktop-menu)" ]; then
    xdg-desktop-menu uninstall --novendor XXXXX.desktop
  else
    rm "/usr/share/applications/XXXXX.desktop"
  fi
fi

exit 0

Note that I need to add Categories=Office; to the file, so Mageia/KDE would actually add it to the menu. It works without that on Ubuntu.
It's still not listed as an application with GUI, but at least it's in the menu so the user can start the application.
And you can't use variables of the script is in a file.