The Mono macpack utility creates a simple info.plist file that sets the app's CFBundleIdentifier and CFBundleExecutable based on your app's name (-n switch). This is probably adequate for getting started, but you'll want to create your own info.plist file eventually. And you probably won't use macpack for an app bundle that you distribute.

If you're not using Xcode you can just create the info.plist yourself. For example, here's a snippet from one of my scripts that does that.

I've noted that using Monobjc, that NSBundle.MainBundle.BundlePath isn't correct at runtime when macpack is used, as well as some other anomalies I can't explain if CFBundleIdentifier is not set. I haven't been able to track down where the problem is, though.

For info about what each key means, see Apple's docs, where they're all explained in great detail.

Thanks.

-Phil


#!/bin/sh
plistfile=MyApp.app/Contents/Info.plist

#
# Create information property list file (Info.plist).
# Tip: By customizing this script for a specific app, you can set
# additional properties such as CFBundleGetInfoString for copyright
# info, CFBundleIconFile for name of icon file (.icns) in Resources,
# and CFBundleIdentifier (example: com.myorganization.myapp), as well
# as more precise CFBundleSignature (change PkgInfo file too) and
# CFBundleVersion strings.
  echo '<?xml version="1.0" encoding="UTF-8"?>' >$plistfile
echo '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0// EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>' >>$plistfile
  echo '<plist version="1.0">' >>$plistfile
  echo '<dict>' >>$plistfile
  echo '  <key>CFBundleDevelopmentRegion</key>' >>$plistfile
  echo '  <string>English</string>' >>$plistfile
  echo '  <key>CFBundleExecutable</key>' >>$plistfile
  echo '  <string>'$exename'</string>' >>$plistfile
  if [ -e "$exename.icns" ]
  then
    echo '  <key>CFBundleIconFile</key>' >>$plistfile
    echo '  <string>'$exename'.icns</string>' >>$plistfile
  fi
  echo '  <key>CFBundleInfoDictionaryVersion</key>' >>$plistfile
  echo '  <string>6.0</string>' >>$plistfile
  echo '  <key>CFBundleName</key>' >>$plistfile
  echo '  <string>'$appname'</string>' >>$plistfile
  echo '  <key>CFBundlePackageType</key>' >>$plistfile
  echo '  <string>APPL</string>' >>$plistfile
  echo '  <key>CFBundleSignature</key>' >>$plistfile
  echo '  <string>'${appname:0:4}'</string>' >>$plistfile
  echo '  <key>CFBundleVersion</key>' >>$plistfile
  echo '  <string>1.0</string>' >>$plistfile
  echo '  <key>CSResourcesFileMapped</key>' >>$plistfile
  echo '  <true/>' >>$plistfile
  echo '</dict>' >>$plistfile
  echo '</plist>' >>$plistfile

Reply via email to