Proper way to locate an .app on Mac OS X / run PackageMaker with XCode 4.3

732 Views Asked by At

Background:

On Mac OS X one can use open -a PackageMaker to run PackageMaker.app, independent of its exact location.

Since XCode 4.3 doesn't install /Developer/usr/bin/packagemaker any more, I would like to run PackageMaker.app/Contents/MacOS/PackageMaker instead in a shell script. The problem is that I cannot rely on any standard location where the user could have put PackageMaker.app. I would like to make sure that the script works an any machine that has PackageMaker.app "installed", even if it resides in user's home.

Question:

How can I determine location from which open -a AnyApp launches AnyApp.app? Or maybe there exists some other command to run a binary inside Contents/MacOS from within an .app with specified name?

1

There are 1 best solutions below

1
On

PackageMaker still exists and is indeed supported by Apple.

You just need to install it.

And to find it, go to http://developer.apple.com/xcode and then click on the "Looking for additional developer tools? View Downloads" link.

When in there, you'll be confronted by more pre-release OS'es and SDK's than you've ever seen before. Uncheck all the download categories ("Applications", "iOS", "Safari", etc.) except the "Developer Tools" one. Then look in the remaining downloadable files for the first "Auxiliary Tools for Xcode" link.

The one I see there right now is dated February 2012 and contains PackageMaker, Clipboard Viewer, CrashReporterPrefs, Help Indexer, Repeat After Me, SRLanguageModeler and SleepX.

And once you install this, you'll have PackageMaker back and in a predictable place.