Comments

1 comment

  • Avatar
    Jake

    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>
    

Please sign in to leave a comment.