Application Bundle

From Free Pascal wiki
Revision as of 13:46, 21 February 2009 by Swen (talk | contribs)
Jump to navigationJump to search

English (en) 日本語 (ja) русский (ru)

macOSlogo.png

This article applies to macOS only.

See also: Multiplatform Programming Guide


Application Bundle is a directory, often with ".app" extension, with special purpose on Mac OS X system. It contains resource files and information about the application. It is necessary for correct execution of applications which are using Carbon Interface.

Creating Application Bundle

From Lazarus

Open project and go to Project -> Project Options -> Application tab and push the Create Application Bundle button. The resulted Application Bundle will have inside symbolic link to the real executable.

Via command-line tool shipped with Lazarus

Open lazarus/components/macfiles/examples/createmacapplication.lpi in the IDE. Compile. Open a Terminal of your choice. Type:

cd project1/
lazarus/components/macfiles/examples/createmacapplication project1
ln -s ../../../project1 project1.app/Contents/MacOS/project1

Use shell script

There is also a script that creates an app bundle for a GTK executable at OS X Programming Tips. You can modify it to use with a Carbon executable (take out the 4 instructions that start the executable with X11). A slightly improved version of this script for Carbon apps is also available for downloading from here.

Executing application via Application Bundle

You can start the application from IDE (checked option Use Application Bundle for running and debugging (darwin only)) or via its Finder icon or in the native Mac OS X Terminal via "open project1.app".