September 19, 2008 · General · Email This Post

Sponsored Link
In order to make your application appear in the Add/Remove tool (gnome-app-install), there are two steps to make:

* add a "X-AppInstall-Package" line to your .desktop
* and run "update-app-install" to update the database


Setting up the .desktop

The application presents to the user a list of applications which can be installed or removed.  These applications are either end-user applications (such as OpenOffice, GIMP, Pidgin) or server-side roles (HTTP server, FTP server).These can be added and removed by toggling a check box.  The applications will
be shown in a tree identical to the Applications menu on the panel, and system roles in a separate list.

The package information based on Freedesktop .desktop files.  This is due to all end-user applications already having a .desktop file which can be extended with a small amount of metadata for use by the application install tool.  These .desktop files will be extracted from the Hoary archive automatically and a
package solely containing .desktop files and the relevant icons created.

For a package to be available the .desktop file must have a X-AppInstall-Package key under the [Desktop Entry] group, which is the name of the package the desktop file relates too.  The Name, Comment and Icon keys will be used in the interface.

Example 1: Sound Juicer

[Desktop Entry]
Encoding=UTF-8
Name=Sound Juicer CD Ripper
Comment=Extract music from your CDs
Exec=sound-juicer
Icon=sound-juicer.png
StartupNotify=true
Terminal=false
Type=Application
Categories=GNOME;Application;AudioVideo;
X-AppInstall-Package=sound-juicer

The only change her from the upstream .desktop file is the X-AppInstall-Package key, which marks this application as to be displayed in the interface. The existing Name, Comment and Icon fields are displayed to the user in the interface.

Example 2: OpenOffice.org

OpenOffice.org installs a number of .desktop files, none of which are suitable for displaying in an Application Install tool as they are for particular aspects of the suite (i.e. Writer or Impress).  In this case a new .desktop file is added to the package, which contains the required information alongside a
Hidden=true key.  The Hidden key ensures that it won't be displayed in any application menus, but can be picked up by the Application Install Tool.

[Desktop Entry]
Encoding=UTF-8
Name=OpenOffice.org
Comment=Powerful office suite
Icon=ooo.png
Type=Application
Categories=GNOME;Application;Office;
X-AppInstall-Package=openoffice.org

The menu layout is based upon the Freedesktop menu specification.  Currently GNOME does not support this standard, but hopefully GNOMEE 2.10 will.  At the moment the Application Install Tool includes a copy of the Applications menu structure in the Freedesktop menu format, which can be removed if GNOME 2.10
does move to it. [note: this depends on API additions to PyXDG]

you simply add the X-AppInstall-Package=<package name> line to your .desktop. Add/Remove will automatically use the description, name, and icon in it's display.

Updating the database

To update Add/Remove's database, you need to run "sudo update-app-install". After that, your .desktop will appear in it's index as a regular program!

However, by default update-app-install will scan all .desktop files in your system, which on low-end systems can take a while. To help speed that up, you can use the "sudo update-app-install -d <directory of the .desktop>" syntax -- point it to the directory where your .desktop is and things will be considerably faster.

Source from here and thanks to the application author Vadim peretoki

Sponsored Link

Incoming search terms:

Related posts

6 Comments to “How to make your application appear in the Add/Remove tool (gnome-app-install)”

  1. ell says:

    hi, say for example a user adds a PPA repo and those packages in that repo had .desktop files and with X-AppInstall-Package entries on it. will the application be visible in add/remove after he apt-get update?

    [Reply]

  2. Vadim P. says:

    @Ell: The script here is supposed to do the crawling and auto-add things. I’ll add that to the original guide.

    [Reply]

  3. Dave Stikkolorum says:

    For me this did not work on Ubuntu (8.04 Hardy) Do you have an other suggestion?

    [Reply]

  4. Vadim P. says:

    Did you run “sudo update-app-install”? (also, ignore the -d, it does something different as I found out and I’ll remove it from the wiki)

    [Reply]

  5. naren says:

    Dear All,
    Accidentally I deleted Add/Remove tool from main menu settings.Now I am not able to restore this icon in the application menu. Anybody help me to appear again this launcher on same place.
    Regards
    Naren

    [Reply]

  6. ribot says:

    Hi!
    Too bad Vadim P didn’t remove it from the wiki yet. If you add this line “sudo update-app-install -d ” it seems like all files disappear. To fix this, do “sudo update-app-install” and wait for the process.

    [Reply]

Leave a Reply