home | faq | discussion  
 

OS use of Application Bundles

by David Jeske

Overview

In order to understand how to best implement OpenBundle, it's useful to see how it was implemented in other operating systems. This document includes information about Nextstep, MacOS X, ROX-Filer, and Acorn RISCOS.

Nextstep

In Nextstep, applications are atomic items which could be installed merely by copying, and could be relocated anywhere. You can see some ".app" applications in this screenshot of the Nextstep file viewer. Note that while they are actually directories, the file manager creates the illusion that they are atomic items.

All of the data the system needs to use the app (i.e. the app icon, mimetypes, services, etc) are all contained in passive datafiles inside the app. There is no need for an installer to "insert" these entries into a Windows-style registry, or copy them into /usr/gnome/*. The filemanager automatically detects the application and extracts/caches the necessary information. 'Installing' an application is handled by merely copying it into the system, and deinstalling the app is merely deleting it.

The application directory wrapper contains all the applications datafiles, which are non-mutable. The application accesses these datafiles through a method call in the Application class which handles finding the datafiles, regardless of where the application is located. This "findResource" API also handles a preference scheme including choosing language-specific resources over general resources.

[More Nextstep screenshots]


Example Application Bundle Layout

Below is an example of what one finds inside a Nextstep application wrapper directory. Nextstep used resources inside the main Mach-O executable to store the main app-icon, filetypes handled, and icons for handled filetypes. This is largly a holderover from the earlier days when Nextstep did not have application wrapper directories. Services, which were introduced later, were stored in a Services description file.
MyApp.app/
    MyApp                        (executable code, app icon, mimetypes)
    Services.txt                 (callable services)
    Resources/
        Pretty.tiff              (nonlocalized resource)
        English.lproj/           (localized resources)
            Stop.eps
            MyBundle.nib
            MyBundle.strings
        French.lproj/            (localized resources)
            Stop.eps
            MyBundle.nib
            MyBundle.strings

The wrapper directory concept also applied to plug-ins, sometimes called "bundles". These could either be named generically ".bundle", or they could be named with a file-extension specific to the application. For example, Backspace.app was a screensaver, and Stars.backmod was a screensaver module.

In Nextstep 4.0/Openstep, wrappers were extended to development libraries as .framework bundles. The includes, libraries, and documentation for a framework were all packaged in the bundle, which could be copy-installed onto the system.

MacOS X

MacOS X is built on Nextstep technology, and with it came Nextstep style application wrappers. Some components resemble the old Nextstep structure, while others, such as "Versions" and the top-level "Contents" are new. There are numerous articles explaining and extoling about the virtues of Bundles. Here are a few of them:

Below is an example of the contents of a MacOS X bundle. You can also read Apple's Anatomy of a Bundle.

iTerm.app
  Contents/
    Info.plist
    pbdevelopment.plist
    PkgInfo
    MacOS/
      iTerm*
    Resources/
      close.png
      iTerm.png
      iTerm.icns
      ... (more icons)
      English.lproj/
        MainMenu.nib
        iTerm Help/
          ... (html help files and gifs)
    Frameworks/   
      iTerm.framework/
        Resources -> Versions/Current/Resources/
        iTerm -> Versions/Current/iTerm
        Versions/
          Current -> A/
          A/
            iTerm*
            Resources/
              Info.plist
              pbdevelopment.plist
              addressbook.png
              close.png
              config.png
              exec.png
              iTerm.png
              iTerm.scriptSuite
              ... (more icons)
              Fonts/
                FreeMono.ttf
                FreeMonoBold.ttf
                FreeMonoBoldOblique.ttf
                FreeMonoOblique.ttf
              English.lproj/
                AddressBook.nib
                FindPanel.nib
                PreferencePanel.nib
                PseudoTerminal.nib
                iTerm.scriptTerminology
                iTerm.strings
              French.lproj/
               ... (same files as english) 
              ... (more languages)

RoX Filer

The ROX-Filer is a graphical file manager built for the X Window System. It supports an Application Encapsulation standard patterened after Acorn RiscOS. Application Directories follow a particular layout standard and contain an AppInfo.xml description file.

Acorn RiscOS

RISCOS tools were installed in directory wrappers as well. Instead of using file extensions to mark wrappers, they were named with bang (!) as the first letter of the directory name. For example, "!Printers" is the printer manager, "!MakeModes" is an application for making monitor mode lines, and "!Edit" is an editor.
 
Copyright © 2002 Neotonic Software Corporation, All rights reserved.