2

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?

Mojca
  • 304
  • 1
  • 3
  • 14
  • One option would be to use LaunchServices to locate the application wherever it might have been installed too. You will need to parse the output to determine the path though. See [here](http://superuser.com/questions/323599/is-it-possible-to-query-the-launch-services-database-for-applications-that-will). – Perception May 30 '12 at 11:42
  • Thank you for the hint. I'm still investigating this option. – Mojca May 31 '12 at 08:31

1 Answers1

3

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.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • I already installed PackageMaker, but its place is far from being predictable. One can put PackageMaker.app to `/Applications/Developer/` for example. – Mojca May 31 '12 at 08:29