Zero Install

Dr Thomas Leonard [ contact | GPG public key | blog | donations ]

Contents

  1. Introduction
  2. Adding a new launcher
  3. Confirming keys
  4. Downloading and running
  5. List of Zero Install software
Embedded video not supported by your browser

Tutorial 1: Launchers

(screencast with audio commentary)

Introduction

Zero Install's 0launch command takes a URI (e.g. http://rox.sourceforge.net/2007/interfaces/Reinteract.xml) and runs the corresponding program.

Although 0launch can be run manually, it is normally invoked by a launcher. A launcher simply provides an easy way to run a program without entering the full URI, rather as a bookmark in a web-browser provides an easy way to return to a web page without entering the full URL. Examples of launchers include:

  • When a GNOME or KDE user drags a web-browser link to the Zero2Desktop program, it creates an entry on the Applications menu that uses it.
  • When a ROX desktop user drags a web-browser link to the AddApp program, it creates a launcher application that uses it.
  • When an Xfce user drags a web-browser link to the xfce4-panel program, it creates a launcher button that uses it.
  • When a shell user runs the 0alias command, it creates a shell short-cut that runs it.

Launchers diagram

A launcher provides an easy way to run a program.

However, you can always run the 0launch command manually yourself. For example, entering this in a terminal emulator (such as xterm, gnome-terminal or konsole) will run the Edit application from the ROX desktop:

$ 0launch http://rox.sourceforge.net/2005/interfaces/Edit

Adding a new launcher

Different environments provide different ways to add launchers.

GNOME

Choose Zero Install -> Add New Program from the Applications menu. Type in the URI, or drag it from the web-browser into the dialog box. This video above demonstrates this.

Adding with GNOME

Note that on older versions, the menu item is labelled Zero2Desktop and it's on the System/Preferences menu.

Ubuntu users: You need to open and then close the menu editor after adding a program before it will show up; see Ubuntu bug #191958.

KDE

Choose Add Zero Install Program from the Utilities menu. Type in the URI, or drag it from the web-browser into the dialog box.

Adding with KDE

ROX

Drag the link from your web-browser to the AddApp program, then drag the launcher from there to wherever you want it. AddApp's page has more details.

Adding with ROX

Shell

The 0alias command can be used to create little shell scripts to start programs easily:

$ 0alias rox-edit http://rox.sourceforge.net/2005/interfaces/Edit
Created script '/home/talex/bin/rox-edit'.
To edit policy: rox-edit --versions
(note: some shells require you to type 'rehash' now)

The command puts the script in the first writable directory in your $PATH. You can now run Edit like this:

$ rox-edit

Confirming keys

Once 0launch has been run (either manually or by a launcher), it chooses a suitable version of the program and runs it. If it doesn't know about this program yet then it will need to download some information about it first. If you tried the Edit example above, you're probably looking at this dialog box now:

Confirming Thomas Leonard's GPG key

So what happened?

  1. 0launch realised that it needed to download some files to run Edit, so it switched to graphical mode (use --console to disable this).
  2. It downloaded Edit's feed file and the GPG key that signed it.
  3. It prompts you to confirm that you trust this key to sign feeds from rox.sourceforge.net.

The important thing in this box is the fingerprint, since it can't be faked: anyone can create a key with the name "Thomas Leonard", but noone knows how to create another key with this fingerprint.

Ideally, you should check the fingerprint somehow (maybe the person who recommended Edit to you told you the fingerprint). However, there's a handy hints database built into Zero Install to help you out. It's called "unreliable" because I don't have the funding to verify people's keys, so it's just a list of keys that have been announced on the mailing list, but it's better than nothing. Obviously, I can't accept any kind of legal liablity for its accuracy, but you could pay someone to provide a real service if you needed that.

  1. Once the key is confirmed, 0launch looks at the information it has downloaded about Edit.
  2. Edit requires the ROX-Lib library, so it fetches ROX-Lib's feed too. This is also signed with my key and comes from the ROX domain, so you don't need to confirm again.

Downloading and running

After downloading information about Edit and its dependencies, 0launch selects suitable versions of them and prompts you to confirm:

Running Edit with the injector

The main part of the window contains a list of all the components needed to run Edit. At the top is Edit itself, and shown below is ROX-Lib, which Edit needs in order to function. If you are happy with the selected versions, click on Run to download and run the program (selecting different versions is covered in part two of this tutorial):

Edit running

By default, the GUI confirmation box is only shown if something must be downloaded. If you run the command again once Edit has been cached, Edit will run immediately. To get back to the dialog box, use the --gui option:

$ 0launch --gui http://rox.sourceforge.net/2005/interfaces/Edit

List of Zero Install software

See the packages page for a list of software currently available through Zero Install. When you're ready, you can continue with the tutorial using the link below: