Application directory


An application directory is a grouping of software code, help files and resources that together comprise a complete software package but are presented to the user as a single object.
They are currently used in RISC OS and the ROX Desktop, and also form the basis of the Zero Install application distribution system. Similar technology includes VMware ThinApp, and the NEXTSTEP/GNUstep/Mac OS X concept of application bundles. Their heritage lies in the system for automatically launching software stored on floppy disk on Acorn's earlier 8-bit micros such as the BBC Micro.
Bundling various files in this manner allows tools for manipulating applications to be replaced by tools for manipulating the file system. Applications can often be "installed" simply by dragging them from a distribution medium to a hard disk, and "uninstalled" by deleting the application directory.

Fixed contents

In order to support user interaction with application directories, several files have special status.

Application binaries

Launching an application directory causes the included file AppRun or !Run to be launched. On RISC OS this is generally an Obey file which allocates memory and loads OS extension modules and shared libraries before executing the application binary, usually called !RunImage. Under the ROX Desktop, it is not uncommon for it to be a shell script that will launch the correct system binary if available or compile a suitable binary from source otherwise.

Help files and icons

Both RISC OS and the ROX Desktop allow the user to view help files associated with an application directory without launching the application. RISC OS relies on a file in the directory named !Help which is launched as if the user double-clicked on it when help is requested, while the ROX Desktop opens the application’s Help subdirectory.
Similarly, custom icons for the Application Directory may be contained within it—either .DirIcon or AppIcon.xpm under the ROX Desktop, or !Sprites and optionally !Sprites22 under RISC OS. The RISC OS Filer automatically loads these sprite files in the absence of a !Boot file, otherwise it is left to the !Boot file to load the appropriate icons.

!Boot

RISC OS application directories may contain a file named !Boot which is executed by the Filer either explicitly via the FilerBoot command, or when the bundle is first displayed.
This allows an application to do tasks such as register supported filetypes, or choose to load different icons such as ASprites, 5Sprites or theme-specific icons.
!Boot files are the most popular propagation vector for such RISC OS viruses as exist, though they can be defeated simply by holding Control.
The !Boot feature is not duplicated by the ROX Desktop.

The RISC OS !Boot system directory

Acorn's early machines allowed a medium to be "booted" by executing a file called !BOOT if present. This was exploited in the RISC OS disc structure by having an application directory in the root of the default disc called !Boot.
This application directory is executed when the machine boots, therefore causing its !Run file to be executed. This file then causes various files to be executed, OS modules loaded, standard icons to be loaded and filetypes defined, and defines a number of standard variables through which its various subdirectories are accessed. Thus RISC OS's entire boot sequence can be avoided merely by holding Shift.