VirtualBox

Ticket #6156 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Debian package - doesn't update desktop database

Reported by: Havok Owned by:
Priority: trivial Component: installer
Version: VirtualBox 3.1.2 Keywords: debian, .deb, package
Cc: Guest type: other
Host type: other

Description

Trivial bug.

When installing VirtualBox from the Debian package hosted on this site, just after the installation the VirtualBox icon doesn't show up on the menu.

Tested on Jaunty and Karmic, on Gnome.

This is trivial, just add a postinst script (post installation script, default structure for debian packages) before building the package, like this one:

#!/bin/sh
set -e

if [ "$1" = "configure" ] && which update-desktop-database >/dev/null 2>&1 ; then
        update-desktop-database -q
fi

Change History

comment:1 Changed 4 years ago by frank

The interesting thing is that the icon appears on some Ubuntu installations, on some other not. I assume that there must be another way to force this icon into the menu because desktop-file-utils, the package update-desktop-database belongs to, is only an optional package. And looking at all postinst scripts of my installed Ubuntu host only googleearth, xpdf and sun-java6-bin call this tool. Can you point me to some documentation?

comment:2 Changed 4 years ago by frank

From  here: Use this when a desktop entry has a MimeType key. And VBox doesn't register any mime type for sure.

comment:3 Changed 4 years ago by Havok

Mmm i see... until now I made it that way...

Still searching, but from the Google Chrome debian package:

# Add an entry to the system menu
XDG_DESKTOP_MENU="`which xdg-desktop-menu 2> /dev/null`"
UPDATE_MENUS="`which update-menus 2> /dev/null`"
if [ ! -x "$XDG_DESKTOP_MENU" ]; then
  echo "Error: Could not find xdg-desktop-menu" >&2
  exit 1
fi

"$XDG_DESKTOP_MENU" install /opt/google/chrome/google-chrome.desktop

if [ -x "$UPDATE_MENUS" ]; then
  update-menus
fi

Actually, it's not clear why they use both, I think because they want to update both menus if they exits.

It is supposed that xdg-desktop-menu install actually updates the database just after the install (see man page). This method is opposed to put the .desktop file in the /usr/share/applications folder on the debian package but with the advantage of the immediate update. Maybe, we can put the .desktop file in /usr/share/applications and then call xdg-desktop-menu forceupdate

As I understand update-menus updates the Debian menu, which is another different menu structure.

So, I still don't know how to fix that in the optimum way.

Cheers

comment:4 Changed 3 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

I think this was fixed some time ago.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use