How to run .app applications on Mac OS X

asked 13 Sep '11, 06:03

Jake's gravatar image

Jake ♦♦
796222226235
accept rate: 98%


Sometimes, as part of a Mac OS X install, it is necessary to run a .app application. A .app application is indeed a directory, with a well defined structure. Mac OS X recognizes and interprets it as an application when invoked through the graphical interface (i.e., from Finder). InstallBuilder <runProgram> action works like a command line invocation, so you have two options to invoke a .app from command line:

Option 1: Run it through the OS X shell command "open":

  <runProgram>
     <program>open</program>
     <programArguments>/path/to/your.app</programArguments>
  </runProgram>

This has the drawback that the OS will return control immediately after invocation, so the installer will continue its work at the same time than the .app is running, which may or may not work for your particular situation.

Option 2: Explore the .app structure, looking for the executable file. It is usually stored under "ApplicationName.app/Contents/MacOS/". The exact name can be found in another file inside the bundle: Contents/Info.plist. This is a text file that should contain something similar to:

<key>CFBundleExecutable</key>
<string>myExecutable</string>

Where myExecutable is the name of your particular application. In that case, you could use a runProgram action as shown below:

  <runProgram>
     <program>/path/to/your.app/Contents/MacOS/myExecutable</program>
     <programArguments>arguments go here</programArguments>
  </runProgram>
link

answered 13 Sep '11, 06:08

Jake's gravatar image

Jake ♦♦
796222226235
accept rate: 98%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×88
×10
×8

Asked: 13 Sep '11, 06:03

Seen: 39,670 times

Last updated: 13 Sep '11, 06:08