Bundle
From REALbasicWiki
This article applies only to Mac
| Overall article skill | ✭ |
On Mac OS X, a bundle is a folder which appears as a single file in the Finder and all the system-provided windows, e.g. open or save files.
For example, an application "file" is actually a bundle which contains, in the folder ((bundle))/Contents (not exhaustive list):
-
Info.plistfile
- Contains major information about the application.
-
Frameworksfolder
- If exists, contains the other frameworks (a bundle wrapping a dynamic library, or "DLL"), that the application needs.
-
MacOSfolder
- Contains the actual executable code of the application. In fact, their can be several executable files for the different systems (Mac OS 9/Classic, Mac OS X...) for backward compatibility.
-
PkgInfofile
- Compatibility file.
-
Resourcesfolder
- Contains all the resources that the application needs, whatever their type: helps files (as PDF, HTML or whatever), icons, pictures etc. This is also where localized data are stored (e.g. french localization in folder
French.lproj); note that the localized resources are automatically chosen, according to the user's preferences, by the system on launching.
-
version.plistfile
- Some more information about the application.
When you double-click on an application bundle (it appears like a single file with the application icon in the Finder), the System:
- Reads the different information files inside the bundle
- Chooses the appropriate executable file
- Select the localized resources (this is totally transparent to the application)
- Starts up application
[edit] What's the goal ?
The goal is just to make things easier to the end-user and this is a thing Apple Inc is really committed to.
Instead of trying to encode/integrate every resource into one single file, a bundle can contain absolutely any file while still looking like a single file. It can even contains other applications, other bundles, dynamic libraries, files of any type, ... For example, an application does not need to be installed (most of the time) like under Windows or Linux because it is actually a bundle which contains all the stuff it needs and in all the languages it provides. Uninstall is also something nearly unknown to the mac-user: to uninstall an application, you just need to move it to the trash (the whole bundle with all the additional data is moved to the trash).
[edit] More information
- Bundles document from Apple (accessed 2008-03-01).
