1

We have 4 mac applications that form part of a 'suite', each for use with a different scientific instrument connected via USB.

My colleagues on Windows have developed a splash screen app that lets you choose one of the four separate programs to run, depending on what instrument you are using. On Windows this splash screen app is in the same folder as the other executables and all the dependencies and libraries are included in the same folder as well. So its as easy as clicking the required radio button and then that program will launch.

What I was hoping to do on Mac OS X was to bundle the 4 separate programs into one app bundle and also the splash screen, so that when the application is launched the user will be presented with the splash screen, then when you choose the appropriate app it gets launched automatically.

The dependencies and libraries are common for all the apps.

I'm comfortable building an app bundle with all the dependencies using the mac deployment tool but i'm unsure if its possible to build multiple binaries into one app bundle, and how to set the default app to be launched (the splash screen).

Thanks in advance :)

Mitch

Mitchell D
  • 465
  • 8
  • 24
  • 1
    Not sure on the details, but it's definitely possible -- even macdeployqt itself will insert the WebKit and WebEngine executables into the app bundle if you're using those modules. – MrEricSir Jun 03 '15 at 03:07

1 Answers1

3

Yes, multiple app bundles inside another app bundle is possible.

how to set the default app to be launched

As you're probably aware, when you build a bundle, the main executable binary file is resident in the bundle's Contents/MacOS folder.

Also in the bundle is the Info.plist file, which is a manifest that OS X uses, amongst other things, to know which binary to execute when the user runs the application. In this case, the key CFBundleExecutable names the binary in the Contents/MacOS folder.

If you copy the other application bundles to the Resources folder, you can then locate them from the Splash Screen app and execute as required.

Community
  • 1
  • 1
TheDarkKnight
  • 27,181
  • 6
  • 55
  • 85
  • 1
    Your other applications don't have to be whole bundles, they can just be executables copied into Contents/MacOS too. And you can tell macdeployqt about them on the command line so that it copies the frameworks those other binaries need too. – Hamish Moffatt Jun 04 '15 at 00:54
  • Thanks guys, do you think you could elaborate more on how to reference the Resources folder from the code of the splash screen app? – Mitchell D Jun 11 '15 at 06:23
  • That's what I did when I linked to [here](http://stackoverflow.com/questions/24165681/accessing-files-in-resources-folder-in-mac-osx-app-bundle/24165954#24165954) in the answer. – TheDarkKnight Jun 11 '15 at 08:04
  • ah yes, sorry I didn't see. Another issue I'm having, changing the CFBundleExecutable variable to a different binary file doesn't change which program is executed first, is this supposed to be changeable after compilation or should it be specified before hand? – Mitchell D Jun 12 '15 at 05:35
  • Please start a new question for the new problem. That will give it more visibility and a better chance for you to get a good answer. – TheDarkKnight Jun 12 '15 at 07:58