Index: trunk/src/VBox/Installer/darwin/VBoxKEXTs/Description.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxKEXTs/Description.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxKEXTs/Description.plist	(revision 31655)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>IFPkgDescriptionTitle</key>                <string>@VBOX_PRODUCT@ Kernel Extensions</string>
+        <key>IFPkgDescriptionDescription</key>          <string>Installs the @VBOX_PRODUCT@ Kernel Extensions into /Library/Extensions.</string>
+        <key>IFPkgDescriptionVersion</key>              <string>@VBOX_VERSION_STRING@</string>
+        <key>IFPkgDescriptionDeleteWarning</key>        <string></string>
+</dict>
+</plist>
+
Index: trunk/src/VBox/Installer/darwin/VBoxKEXTs/English.lproj/InstallationCheck.strings
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxKEXTs/English.lproj/InstallationCheck.strings	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxKEXTs/English.lproj/InstallationCheck.strings	(revision 31655)
@@ -0,0 +1,1 @@
+"16" = "VirtualBox can only be installed on Intel Macs.";
Index: trunk/src/VBox/Installer/darwin/VBoxKEXTs/Info.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxKEXTs/Info.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxKEXTs/Info.plist	(revision 31655)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>CFBundleIdentifier</key>                   <string>org.virtualbox.pkg.vboxkexts</string>
+        <key>CFBundleName</key>                         <string>The @VBOX_PRODUCT@ Kernel Extensions Package</string>
+        <key>CFBundleGetInfoString</key>                <string>@VBOX_PRODUCT@ @VBOX_VERSION_STRING@, © 2009-@VBOX_C_YEAR@ @VBOX_VENDOR@</string>
+        <key>CFBundleShortVersionString</key>           <string>@VBOX_VERSION_MAJOR@.@VBOX_VERSION_MINOR@.@VBOX_VERSION_BUILD@</string>
+        <key>IFMajorVersion</key>                       <integer>@VBOX_VERSION_MAJOR@</integer>
+        <key>IFMinorVersion</key>                       <integer>@VBOX_VERSION_MINOR@</integer>
+        <key>IFPkgFlagAllowBackRev</key>                <false/>
+        <key>IFPkgFlagAuthorizationAction</key>         <string>RootAuthorization</string>
+        <key>IFPkgFlagDefaultLocation</key>             <string>/</string>
+        <key>IFPkgFlagInstallFat</key>                  <false/>
+        <key>IFPkgFlagIsRequired</key>                  <true/>
+        <key>IFPkgFlagRelocatable</key>                 <false/>
+        <key>IFPkgFlagRestartAction</key>               <string>NoRestart</string>
+        <key>IFPkgFlagRootVolumeOnly</key>              <true/>
+        <key>IFPkgFlagUpdateInstalledLanguages</key>    <false/>
+        <key>IFPkgFormatVersion</key>                   <real>0.10000000149011612</real>
+        <key>IFPkgFlagOverwritePermissions</key>        <false/>
+</dict>
+</plist>
+
Index: trunk/src/VBox/Installer/darwin/VBoxKEXTs/InstallationCheck
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxKEXTs/InstallationCheck	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxKEXTs/InstallationCheck	(revision 31655)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+#
+# Copyright (C) 2006-2010 Oracle Corporation
+#
+# Use only with permission.
+#
+
+MACHINE=`uname -m`
+# Check that this is an x86/x86_64 system.
+if test "$MACHINE" != "i386" && test "$MACHINE" != "x86_64"; then
+    exit 112 # (112 = 96 + 16)
+fi
+exit 0
+
Index: trunk/src/VBox/Installer/darwin/VBoxKEXTs/ReadMe.html
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxKEXTs/ReadMe.html	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxKEXTs/ReadMe.html	(revision 31655)
@@ -0,0 +1,6 @@
+<font face="sans-serif">
+<p>This package installs VBoxDrv.kext, VBoxUSB.kext, VBoxNetFlt.kext and
+VBoxNetAdp.kext into /Library/Extensions. At the end of the installation it
+will load the extensions. Note that the extensions will not be loaded
+automatically at boot time unless you also install the @VBOX_PRODUCT@ startup
+item.</p> </font>
Index: trunk/src/VBox/Installer/darwin/VBoxKEXTs/postflight
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxKEXTs/postflight	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxKEXTs/postflight	(revision 31655)
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+#
+# Copyright (C) 2007-2010 Oracle Corporation
+#
+# Use only with permission.
+#
+
+#
+# Unload any old extension that might be loaded already (ignore failures).
+#
+sync
+if kextstat -lb org.virtualbox.kext.VBoxNetAdp 2>&1 | grep -q org.virtualbox.kext.VBoxNetAdp; then
+    kextunload -m org.virtualbox.kext.VBoxNetAdp
+fi
+if kextstat -lb org.virtualbox.kext.VBoxNetFlt 2>&1 | grep -q org.virtualbox.kext.VBoxNetFlt; then
+    kextunload -m org.virtualbox.kext.VBoxNetFlt
+fi
+if kextstat -lb org.virtualbox.kext.VBoxUSB 2>&1 | grep -q org.virtualbox.kext.VBoxUSB; then
+    kextunload -m org.virtualbox.kext.VBoxUSB
+fi
+if kextstat -lb org.virtualbox.kext.VBoxDrv 2>&1 | grep -q org.virtualbox.kext.VBoxDrv; then
+    kextunload -m org.virtualbox.kext.VBoxDrv
+fi
+
+#
+# Load the extension, exit on first error.
+#
+sync
+kextload    /Library/Extensions/VBoxDrv.kext
+kextload -d /Library/Extensions/VBoxDrv.kext      /Library/Extensions/VBoxUSB.kext
+kextload -d /Library/Extensions/VBoxDrv.kext      /Library/Extensions/VBoxNetFlt.kext
+kextload -d /Library/Extensions/VBoxDrv.kext      /Library/Extensions/VBoxNetAdp.kext
+
Index: trunk/src/VBox/Installer/darwin/VBoxStartupItems/Description.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxStartupItems/Description.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxStartupItems/Description.plist	(revision 31655)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>IFPkgDescriptionTitle</key>                <string>@VBOX_PRODUCT@ Startup Items</string>
+        <key>IFPkgDescriptionDescription</key>          <string>Installs the @VBOX_PRODUCT@ Startup Items to /Library/StartupItems/VirtualBox.</string>
+        <key>IFPkgDescriptionVersion</key>              <string>@VBOX_VERSION_STRING@</string>
+        <key>IFPkgDescriptionDeleteWarning</key>        <string></string>
+</dict>
+</plist>
Index: trunk/src/VBox/Installer/darwin/VBoxStartupItems/Info.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxStartupItems/Info.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxStartupItems/Info.plist	(revision 31655)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>CFBundleIdentifier</key>                   <string>org.virtualbox.pkg.vboxstartupitems</string>
+        <key>CFBundleName</key>                         <string>The @VBOX_PRODUCT@ Startup Items Package</string>
+        <key>CFBundleGetInfoString</key>                <string>@VBOX_PRODUCT@ @VBOX_VERSION_STRING@, © 2009-@VBOX_C_YEAR@ @VBOX_VENDOR@</string>
+        <key>CFBundleShortVersionString</key>           <string>@VBOX_VERSION_MAJOR@.@VBOX_VERSION_MINOR@.@VBOX_VERSION_BUILD@</string>
+        <key>IFMajorVersion</key>                       <integer>@VBOX_VERSION_MAJOR@</integer>
+        <key>IFMinorVersion</key>                       <integer>@VBOX_VERSION_MINOR@</integer>
+        <key>IFPkgFlagAllowBackRev</key>                <false/>
+        <key>IFPkgFlagAuthorizationAction</key>         <string>RootAuthorization</string>
+        <key>IFPkgFlagDefaultLocation</key>             <string>/</string>
+        <key>IFPkgFlagInstallFat</key>                  <false/>
+        <key>IFPkgFlagIsRequired</key>                  <true/>
+        <key>IFPkgFlagRelocatable</key>                 <false/>
+        <key>IFPkgFlagRestartAction</key>               <string>NoRestart</string>
+        <key>IFPkgFlagRootVolumeOnly</key>              <true/>
+        <key>IFPkgFlagUpdateInstalledLanguages</key>    <false/>
+        <key>IFPkgFormatVersion</key>                   <real>0.10000000149011612</real>
+        <key>IFPkgFlagOverwritePermissions</key>        <false/>
+</dict>
+</plist>
Index: trunk/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/Resources/English.lproj/Localizable.strings
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/Resources/English.lproj/Localizable.strings	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/Resources/English.lproj/Localizable.strings	(revision 31655)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+        <key>VirtualBox Support Driver</key>                                    <string>VirtualBox Support Driver</string>
+        <key>Loading VBoxDrv.kext</key>                                         <string>Loading VBoxDrv.kext</string>
+        <key>Loading VBoxUSB.kext</key>                                         <string>Loading VBoxUSB.kext</string>
+        <key>Loading VBoxNetFlt.kext</key>                                      <string>Loading VBoxNetFlt.kext</string>
+        <key>Loading VBoxNetAdp.kext</key>                                      <string>Loading VBoxNetAdp.kext</string>
+        <key>Unloading VBoxDrv.kext</key>                                       <string>Unoading VBoxDrv.kext</string>
+        <key>Unloading VBoxUSB.kext</key>                                       <string>Unoading VBoxUSB.kext</string>
+        <key>Unloading VBoxNetFlt.kext</key>                                    <string>Unoading VBoxNetFlt.kext</string>
+        <key>Unloading VBoxNetAdp.kext</key>                                    <string>Unoading VBoxNetAdp.kext</string>
+        <key>Error: /Library/Extensions/VBoxDrv.kext is missing</key>           <string>Error: /Library/Extensions/VBoxDrv.kext is missing</string>
+        <key>Error: /Library/Extensions/VBoxUSB.kext is missing</key>           <string>Error: /Library/Extensions/VBoxUSB.kext is missing</string>
+        <key>Error: /Library/Extensions/VBoxNetFlt.kext is missing</key>        <string>Error: /Library/Extensions/VBoxNetFlt.kext is missing</string>
+        <key>Error: /Library/Extensions/VBoxNetAdp.kext is missing</key>        <string>Error: /Library/Extensions/VBoxNetAdp.kext is missing</string>
+        <key>Error: VBoxDrv.kext is already loaded</key>                        <string>Error: VBoxDrv.kext is already loaded</string>
+        <key>Error: VBoxUSB.kext is already loaded</key>                        <string>Error: VBoxUSB.kext is already loaded</string>
+        <key>Error: VBoxNetFlt.kext is already loaded</key>                     <string>Error: VBoxNetFlt.kext is already loaded</string>
+        <key>Error: VBoxNetAdp.kext is already loaded</key>                     <string>Error: VBoxNetAdp.kext is already loaded</string>
+        <key>Error: Failed to load /Library/Extensions/VBoxDrv.kext</key>       <string>Error: Failed to load /Library/Extensions/VBoxDrv.kext</string>
+        <key>Error: Failed to load /Library/Extensions/VBoxUSB.kext</key>       <string>Error: Failed to load /Library/Extensions/VBoxUSB.kext</string>
+        <key>Error: Failed to load /Library/Extensions/VBoxNetFlt.kext</key>    <string>Error: Failed to load /Library/Extensions/VBoxNetFlt.kext</string>
+        <key>Error: Failed to load /Library/Extensions/VBoxNetAdp.kext</key>    <string>Error: Failed to load /Library/Extensions/VBoxNetAdp.kext</string>
+        <key>Error: Failed to unload VBoxDrv.kext</key>                         <string>Error: Failed to unload VBoxDrv.kext</string>
+        <key>Error: Failed to unload VBoxUSB.kext</key>                         <string>Error: Failed to unload VBoxUSB.kext</string>
+        <key>Error: Failed to unload VBoxNetFlt.kext</key>                      <string>Error: Failed to unload VBoxNetFlt.kext</string>
+        <key>Error: Failed to unload VBoxNetAdp.kext</key>                      <string>Error: Failed to unload VBoxNetAdp.kext</string>
+</dict>
+</plist>
+
Index: trunk/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/StartupParameters.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/StartupParameters.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/StartupParameters.plist	(revision 31655)
@@ -0,0 +1,5 @@
+{
+  Description     = "VirtualBox Support and USB Drivers";
+  Provides        = ("VirtualBox");
+  OrderPreference = "None";
+}
Index: trunk/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/VirtualBox
===================================================================
--- trunk/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/VirtualBox	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/VirtualBox	(revision 31655)
@@ -0,0 +1,187 @@
+#!/bin/sh
+
+#
+# Copyright (C) 2007-2010 Oracle Corporation
+#
+# Use only with permission.
+#
+
+. /etc/rc.common
+
+
+StartService()
+{
+    VBOX_RC=0
+    VBOXDRV="VBoxDrv"
+    VBOXUSB="VBoxUSB"
+
+    #
+    # Switch the binaries to the right architecture.
+    #
+    VBOX_ARCH=`uname -m`
+    if test "$VBOX_ARCH" = "x86_64"; then
+        VBOX_ARCH="amd64"
+    else
+        VBOX_ARCH="x86"
+    fi
+    for VBOX_TRG in `ls /Applications/VirtualBox.app/Contents/MacOS/*-${VBOX_ARCH}`;
+    do
+        VBOX_LINKNAME=`echo "$VBOX_TRG" | sed -e 's|-'"${VBOX_ARCH}"'$||' `
+        if test "$VBOX_LINKNAME" != "$VBOX_TRG"; then
+            rm -f "$VBOX_LINKNAME"
+            if ! ln -vh "$VBOX_TRG" "$VBOX_LINKNAME"; then
+                ConsoleMessage "Error: ln -vh $VBOX_TRG $VBOX_LINKNAME failed"
+                VBOX_RC=1
+            fi
+        else
+            ConsoleMessage "Error: Script error VBOX_TRG=$VBOX_TRG"
+            VBOX_RC=1
+        fi
+    done
+
+    #
+    # Check that all the directories exist first.
+    #
+    if [ ! -d /Library/Extensions/${VBOXDRV}.kext ]; then
+        ConsoleMessage "Error: /Library/Extensions/${VBOXDRV}.kext is missing"
+        VBOX_RC=1
+    fi
+    if [ ! -d /Library/Extensions/${VBOXUSB}.kext ]; then
+        ConsoleMessage "Error: /Library/Extensions/${VBOXUSB}.kext is missing"
+        VBOX_RC=1
+    fi
+    if [ ! -d /Library/Extensions/VBoxNetFlt.kext ]; then
+        ConsoleMessage "Error: /Library/Extensions/VBoxNetFlt.kext is missing"
+        VBOX_RC=1
+    fi
+    if [ ! -d /Library/Extensions/VBoxNetAdp.kext ]; then
+        ConsoleMessage "Error: /Library/Extensions/VBoxNetAdp.kext is missing"
+        VBOX_RC=1
+    fi
+
+    #
+    # Check that no drivers are currently running.
+    # (Try stop the service if this is the case.)
+    #
+    if [ $VBOX_RC -eq 0 ]; then
+        if kextstat -lb org.virtualbox.kext.VBoxDrv 2>&1 | grep -q org.virtualbox.kext.VBoxDrv; then
+            ConsoleMessage -v "Error: ${VBOXDRV}.kext is already loaded"
+            VBOX_RC=1
+        fi
+        if kextstat -lb org.virtualbox.kext.VBoxUSB 2>&1 | grep -q org.virtualbox.kext.VBoxUSB; then
+            ConsoleMessage -v "Error: ${VBOXUSB}.kext is already loaded"
+            VBOX_RC=1
+        fi
+        if kextstat -lb org.virtualbox.kext.VBoxNetFlt 2>&1 | grep -q org.virtualbox.kext.VBoxNetFlt; then
+            ConsoleMessage -v "Error: VBoxNetFlt.kext is already loaded"
+            VBOX_RC=1
+        fi
+        if kextstat -lb org.virtualbox.kext.VBoxNetAdp 2>&1 | grep -q org.virtualbox.kext.VBoxNetAdp; then
+            ConsoleMessage -v "Error: VBoxNetAdp.kext is already loaded"
+            VBOX_RC=1
+        fi
+    fi
+
+    #
+    # Load the drivers.
+    #
+    if [ $VBOX_RC -eq 0 ]; then
+        ConsoleMessage "Loading ${VBOXDRV}.kext"
+        if ! kextload /Library/Extensions/${VBOXDRV}.kext; then
+            ConsoleMessage "Error: Failed to load /Library/Extensions/${VBOXDRV}.kext"
+            VBOX_RC=1
+        fi
+
+        ConsoleMessage "Loading ${VBOXUSB}.kext"
+        if ! kextload -d /Library/Extensions/${VBOXDRV}.kext /Library/Extensions/${VBOXUSB}.kext; then
+            ConsoleMessage "Error: Failed to load /Library/Extensions/${VBOXUSB}.kext"
+            VBOX_RC=1
+        fi
+
+        ConsoleMessage "Loading VBoxNetFlt.kext"
+        if ! kextload -d /Library/Extensions/${VBOXDRV}.kext /Library/Extensions/VBoxNetFlt.kext; then
+            ConsoleMessage "Error: Failed to load /Library/Extensions/VBoxNetFlt.kext"
+            VBOX_RC=1
+        fi
+
+        ConsoleMessage "Loading VBoxNetAdp.kext"
+        if ! kextload -d /Library/Extensions/${VBOXDRV}.kext /Library/Extensions/VBoxNetAdp.kext; then
+            ConsoleMessage "Error: Failed to load /Library/Extensions/VBoxNetAdp.kext"
+            VBOX_RC=1
+        fi
+
+        if [ $VBOX_RC -ne 0 ]; then
+            # unload the drivers (ignoring failures)
+            kextunload -b org.virtualbox.kext.VBoxNetAdp
+            kextunload -b org.virtualbox.kext.VBoxNetFlt
+            kextunload -b org.virtualbox.kext.VBoxUSB
+            kextunload -b org.virtualbox.kext.VBoxDrv
+        fi
+    fi
+
+    #
+    # Set the error on failure.
+    #
+    if [ "$VBOX_RC" -ne "0" ]; then
+        ConsoleMessage -f VirtualBox
+        exit $VBOX_RC
+    fi
+}
+
+
+StopService()
+{
+    VBOX_RC=0
+    VBOXDRV="VBoxDrv"
+    VBOXUSB="VBoxUSB"
+
+    if kextstat -lb org.virtualbox.kext.VBoxUSB 2>&1 | grep -q org.virtualbox.kext.VBoxUSB; then
+        ConsoleMessage "Unloading ${VBOXUSB}.kext"
+        if ! kextunload -m org.virtualbox.kext.VBoxUSB; then
+            ConsoleMessage -v "Error: Failed to unload VBoxUSB.kext"
+            VBOX_RC=1
+        fi
+    fi
+
+    if kextstat -lb org.virtualbox.kext.VBoxNetFlt 2>&1 | grep -q org.virtualbox.kext.VBoxNetFlt; then
+        ConsoleMessage "Unloading VBoxNetFlt.kext"
+        if ! kextunload -m org.virtualbox.kext.VBoxNetFlt; then
+            ConsoleMessage -v "Error: Failed to unload VBoxNetFlt.kext"
+            VBOX_RC=1
+        fi
+    fi
+
+    if kextstat -lb org.virtualbox.kext.VBoxNetAdp 2>&1 | grep -q org.virtualbox.kext.VBoxNetAdp; then
+        ConsoleMessage "Unloading VBoxNetAdp.kext"
+        if ! kextunload -m org.virtualbox.kext.VBoxNetAdp; then
+            ConsoleMessage -v "Error: Failed to unload VBoxNetAdp.kext"
+            VBOX_RC=1
+        fi
+    fi
+
+    # This must come last because of dependencies.
+    if kextstat -lb org.virtualbox.kext.VBoxDrv 2>&1 | grep -q org.virtualbox.kext.VBoxDrv; then
+        ConsoleMessage "Unloading ${VBOXDRV}.kext"
+        if ! kextunload -m org.virtualbox.kext.VBoxDrv; then
+            ConsoleMessage -v "Error: Failed to unload VBoxDrv.kext"
+            VBOX_RC=1
+        fi
+    fi
+
+    # Set the error on failure.
+    if [ "$VBOX_RC" -ne "0" ]; then
+        ConsoleMessage -f VirtualBox
+        exit $VBOX_RC
+    fi
+}
+
+
+RestartService()
+{
+    StopService
+    StartService
+}
+
+
+RunService "$1"
+
Index: trunk/src/VBox/Installer/darwin/VirtualBox/Description.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBox/Description.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBox/Description.plist	(revision 31655)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>IFPkgDescriptionTitle</key>                <string>@VBOX_PRODUCT@</string>
+        <key>IFPkgDescriptionDescription</key>          <string>Installs the @VBOX_PRODUCT@ application into /Applications.</string>
+        <key>IFPkgDescriptionVersion</key>              <string>@VBOX_VERSION_STRING@</string>
+        <key>IFPkgDescriptionDeleteWarning</key>        <string></string>
+</dict>
+</plist>
Index: trunk/src/VBox/Installer/darwin/VirtualBox/Info.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBox/Info.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBox/Info.plist	(revision 31655)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>CFBundleIdentifier</key>                   <string>org.virtualbox.pkg.virtualbox</string>
+        <key>CFBundleName</key>                         <string>The @VBOX_PRODUCT@ Application Package</string>
+        <key>CFBundleGetInfoString</key>                <string>@VBOX_PRODUCT@ @VBOX_VERSION_STRING@, © 2009-@VBOX_C_YEAR@ @VBOX_VENDOR@</string>
+        <key>CFBundleShortVersionString</key>           <string>@VBOX_VERSION_MAJOR@.@VBOX_VERSION_MINOR@.@VBOX_VERSION_BUILD@</string>
+        <key>IFMajorVersion</key>                       <integer>@VBOX_VERSION_MAJOR@</integer>
+        <key>IFMinorVersion</key>                       <integer>@VBOX_VERSION_MINOR@</integer>
+        <key>IFPkgFlagAllowBackRev</key>                <false/>
+        <key>IFPkgFlagAuthorizationAction</key>         <string>RootAuthorization</string>
+        <key>IFPkgFlagDefaultLocation</key>             <string>/</string>
+        <key>IFPkgFlagInstallFat</key>                  <false/>
+        <key>IFPkgFlagIsRequired</key>                  <true/>
+        <key>IFPkgFlagRelocatable</key>                 <false/>
+        <key>IFPkgFlagRestartAction</key>               <string>NoRestart</string>
+        <key>IFPkgFlagRootVolumeOnly</key>              <true/>
+        <key>IFPkgFlagUpdateInstalledLanguages</key>    <false/>
+        <key>IFPkgFormatVersion</key>                   <real>0.10000000149011612</real>
+        <key>IFPkgFlagOverwritePermissions</key>        <false/>
+</dict>
+</plist>
Index: trunk/src/VBox/Installer/darwin/VirtualBox/postflight
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBox/postflight	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBox/postflight	(revision 31655)
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+#
+# Copyright (C) 2007-2010 Oracle Corporation
+#
+# Use only with permission.
+#
+
+#
+# Correct the ownership of the directories in case there
+# was an existing installation.
+#
+chown -R root:admin /Applications/VirtualBox.app
+
+#
+# Select the right architecture.
+#
+MY_ARCH=`uname -m`
+if test "$MY_ARCH" = "x86_64"; then
+  MY_ARCH="amd64"
+else
+  MY_ARCH="x86"
+fi
+set -e
+for trg in `ls /Applications/VirtualBox.app/Contents/MacOS/*-${MY_ARCH}`;
+do
+    linkname=`echo "$trg" | sed -e 's|-'"${MY_ARCH}"'$||' `
+    if test "$linkname" = "$trg"; then
+        echo "oops: $trg" 1>&2
+        exit 1;
+    fi
+    rm -f         "$linkname"
+    ln -vh "$trg" "$linkname"
+done
+
+#
+# Install the Python bindings
+#
+
+VBOX_INSTALL_PATH=/Applications/VirtualBox.app/Contents/MacOS
+PYTHON="python python2.3 python2.5 python2.6"
+if [ -e "${VBOX_INSTALL_PATH}/sdk/installer/vboxapisetup.py" ]; then
+    for p in $PYTHON; do
+    	# Install the python bindings if python is in the path
+    	if [ "`\${p} -c 'print "test"' 2> /dev/null`" = "test" ]; then
+    		echo  1>&2 "Python found: ${p}, installing bindings..."
+    		# Pass install path via environment
+    		export VBOX_INSTALL_PATH
+    		/bin/sh -c "cd $VBOX_INSTALL_PATH/sdk/installer && ${p} vboxapisetup.py install 2> /dev/null"
+    	fi
+    done
+fi
+
+#
+# Install any custom files
+#
+CP="/bin/cp -f"
+CPDIR="${CP} -R"
+DATAPATH="`/usr/bin/dirname "${0}"`/../../../../../.."
+if [ -d "${DATAPATH}/.custom" ]; then
+   echo  1>&2 "Copy ${DATAPATH}/.custom to ${VBOX_INSTALL_PATH}...";
+   ${CPDIR} "${DATAPATH}/.custom/"   "${VBOX_INSTALL_PATH}/custom"
+fi
+
+exit 0;
+
Index: trunk/src/VBox/Installer/darwin/VirtualBoxCLI/Description.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBoxCLI/Description.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBoxCLI/Description.plist	(revision 31655)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>IFPkgDescriptionTitle</key>                <string>@VBOX_PRODUCT@ Command Line Utilities</string>
+        <key>IFPkgDescriptionDescription</key>          <string>Installs the @VBOX_PRODUCT@ command line utilities into /usr/bin.</string>
+        <key>IFPkgDescriptionVersion</key>              <string>@VBOX_VERSION_STRING@</string>
+        <key>IFPkgDescriptionDeleteWarning</key>        <string></string>
+</dict>
+</plist>
Index: trunk/src/VBox/Installer/darwin/VirtualBoxCLI/Info.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBoxCLI/Info.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBoxCLI/Info.plist	(revision 31655)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>CFBundleIdentifier</key>                   <string>org.virtualbox.pkg.virtualboxcli</string>
+        <key>CFBundleName</key>                         <string>The @VBOX_PRODUCT@ Command Line Utilities Package</string>
+        <key>CFBundleGetInfoString</key>                <string>@VBOX_PRODUCT@ @VBOX_VERSION_STRING@, © 2009-@VBOX_C_YEAR@ @VBOX_VENDOR@</string>
+        <key>CFBundleShortVersionString</key>           <string>@VBOX_VERSION_MAJOR@.@VBOX_VERSION_MINOR@.@VBOX_VERSION_BUILD@</string>
+        <key>IFMajorVersion</key>                       <integer>@VBOX_VERSION_MAJOR@</integer>
+        <key>IFMinorVersion</key>                       <integer>@VBOX_VERSION_MINOR@</integer>
+        <key>IFPkgFlagAllowBackRev</key>                <false/>
+        <key>IFPkgFlagAuthorizationAction</key>         <string>RootAuthorization</string>
+        <key>IFPkgFlagDefaultLocation</key>             <string>/</string>
+        <key>IFPkgFlagInstallFat</key>                  <false/>
+        <key>IFPkgFlagIsRequired</key>                  <false/>
+        <key>IFPkgFlagRelocatable</key>                 <false/>
+        <key>IFPkgFlagRestartAction</key>               <string>NoRestart</string>
+        <key>IFPkgFlagRootVolumeOnly</key>              <true/>
+        <key>IFPkgFlagUpdateInstalledLanguages</key>    <false/>
+        <key>IFPkgFormatVersion</key>                   <real>0.10000000149011612</real>
+        <key>IFPkgFlagOverwritePermissions</key>        <false/>
+</dict>
+</plist>
Index: trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Conclusion.html
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Conclusion.html	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Conclusion.html	(revision 31655)
@@ -0,0 +1,7 @@
+<font face="sans-serif">
+
+<p>To start VirtualBox, go to your Applications folder and double click on the
+VirtualBox icon.</p>
+
+</font>
+
Index: trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Description.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Description.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Description.plist	(revision 31655)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IFPkgDescriptionTitle</key>                <string>@VBOX_PRODUCT@</string>
+	<key>IFPkgDescriptionDescription</key>          <string>The @VBOX_PRODUCT@ Package.</string>
+	<key>IFPkgDescriptionVersion</key>              <string>@VBOX_VERSION_STRING@</string>
+	<key>IFPkgDescriptionDeleteWarning</key>        <string></string>
+</dict>
+</plist>
+
Index: trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Info.plist
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Info.plist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Info.plist	(revision 31655)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>CFBundleIdentifier</key>                   <string>org.virtualbox.mpkg.virtualbox</string>
+        <key>CFBundleName</key>                         <string>The @VBOX_PRODUCT@ Package</string>
+        <key>CFBundleGetInfoString</key>                <string>@VBOX_PRODUCT@ @VBOX_VERSION_STRING@, © 2009-@VBOX_C_YEAR@ @VBOX_VENDOR@</string>
+        <key>CFBundleShortVersionString</key>           <string>@VBOX_VERSION_MAJOR@.@VBOX_VERSION_MINOR@.@VBOX_VERSION_BUILD@</string>
+        <key>IFMajorVersion</key>                       <integer>@VBOX_VERSION_MAJOR@</integer>
+        <key>IFMinorVersion</key>                       <integer>@VBOX_VERSION_MINOR@</integer>
+        <key>IFPkgFormatVersion</key>                   <real>0.10000000149011612</real>
+        <key>IFPkgFlagComponentDirectory</key>          <string>./Contents/Packages</string>
+        <key>IFPkgFlagPackageList</key>
+	<array>
+		<dict>
+			<key>IFPkgFlagPackageLocation</key>             <string>VBoxKEXTs.pkg</string>
+			<key>IFPkgFlagPackageSelection</key>            <string>required</string>
+		</dict>
+		<dict>
+			<key>IFPkgFlagPackageLocation</key>             <string>VBoxStartupItems.pkg</string>
+			<key>IFPkgFlagPackageSelection</key>            <string>required</string>
+		</dict>
+		<dict>
+			<key>IFPkgFlagPackageLocation</key>             <string>VirtualBox.pkg</string>
+			<key>IFPkgFlagPackageSelection</key>            <string>required</string>
+		</dict>
+		<dict>
+			<key>IFPkgFlagPackageLocation</key>             <string>VirtualBoxCLI.pkg</string>
+			<key>IFPkgFlagPackageSelection</key>            <string>selected</string>
+		</dict>
+	</array>
+</dict>
+</plist>
Index: trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Localizable.strings
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Localizable.strings	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Localizable.strings	(revision 31655)
@@ -0,0 +1,22 @@
+'VirtualBox_title' = '@VBOX_PRODUCT@';
+
+'choiceVBoxKEXTs_title' = '@VBOX_PRODUCT@ Kernel Extensions';
+'choiceVBoxKEXTs_msg' = 'Installs the @VBOX_PRODUCT@ Kernel Extensions into /Library/Extensions.';
+
+'choiceVBoxStartup_title' = '@VBOX_PRODUCT@ Startup Items';
+'choiceVBoxStartup_msg' = 'Installs the @VBOX_PRODUCT@ Startup Items to /Library/StartupItems/VirtualBox.';
+
+'choiceVBox_title' = '@VBOX_PRODUCT@';
+'choiceVBox_msg' = 'Installs the @VBOX_PRODUCT@ application into /Applications.';
+
+'choiceVBoxCLI_title' = '@VBOX_PRODUCT@ Command Line Utilities';
+'choiceVBoxCLI_msg' = 'Installs the @VBOX_PRODUCT@ command line utilities into /usr/bin.';
+
+'RUNNING_VMS_TLE' = "Running VirtualBox VM's detected!";
+'RUNNING_VMS_MSG' = "The installer has detected running Virtual Machines. Please shutdown all running VirtualBox machines and then restart the installation.";
+
+'UNSUPPORTED_HW_MACHINE_TLE' = "Unsupported hardware architecture detected!";
+'UNSUPPORTED_HW_MACHINE_MSG' = "The installer has detected an unsupported architecture. VirtualBox runs on the x86 architecture only.";
+
+'UNSUPPORTED_OS_TLE' = "Unsupported OS version detected!";
+'UNSUPPORTED_OS_MSG' = "The installer has detected an unsupported operation system. VirtualBox runs on Mac OS X 10.5 and higher only.";
Index: trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Welcome.html
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Welcome.html	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/Welcome.html	(revision 31655)
@@ -0,0 +1,12 @@
+<font face="sans-serif">
+<h2>@VBOX_PRODUCT@ for Mac OS X</h2>
+
+<p>Welcome to @VBOX_PRODUCT@
+@VBOX_VERSION_MAJOR@.@VBOX_VERSION_MINOR@.@VBOX_VERSION_BUILD@ for Mac OS X!
+This installer will guide you through the installation process. In a minute
+from now, you will be able to execute virtual machines running different
+operating systems on your desktop. You will find that VirtualBox delivers a
+great feature set and excellent performance.</p>
+
+</font>
+
Index: trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/checkforrunningvms
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/checkforrunningvms	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/checkforrunningvms	(revision 31655)
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+#
+# Copyright (C) 2008-2010 Oracle Corporation
+#
+# Use only with permission.
+#
+
+GREP=/usr/bin/grep
+PS=/bin/ps
+
+RESULT=0
+
+# Check if there are running vms
+PROCS=`${PS} -e | ${GREP} -E  "VirtualBoxVM.*startvm|VBoxNetDHCP" | ${GREP} -v grep`
+if [ "${PROCS}x" != "x" ]; then
+  RESULT=1;
+fi
+
+exit $RESULT
Index: trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/distribution.dist
===================================================================
--- trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/distribution.dist	(revision 31655)
+++ trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/distribution.dist	(revision 31655)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+#
+# Copyright (C) 2008-2010 Oracle Corporation
+#
+# Use only with permission.
+#
+-->
+<installer-gui-script minSpecVersion="1.0">
+    <title>VirtualBox_title</title>
+    <options customize="allow" allow-external-scripts="yes" rootVolumeOnly="true"/>
+    <installation-check script="checkPrerequisite()"></installation-check>
+    <domains enable_anywhere="true"/>
+    <script>
+    /* js:pkmk:start */
+    function checkPrerequisite()
+    {
+       try
+       {
+         test = system.sysctl('hw.machine');
+         system.log("Hardware architecture detected: " + test);
+         result = !(test == 'i386' || test == 'x86_64');
+       } catch (e) { system.log(e); }
+
+       if(result)
+       {
+         my.result.type = 'Fatal';
+         my.result.title = system.localizedString('UNSUPPORTED_HW_MACHINE_TLE');
+         my.result.message = system.localizedString('UNSUPPORTED_HW_MACHINE_MSG');
+         return result;
+       }
+
+       try
+       {
+         test = system.version['ProductVersion'];
+         system.log("OS version detected: " + test);
+         result = !(system.compareVersions(test, '10.5') >= 0);
+       } catch (e) { system.log(e); }
+
+       if(result)
+       {
+         my.result.type = 'Fatal';
+         my.result.title = system.localizedString('UNSUPPORTED_OS_TLE');
+         my.result.message = system.localizedString('UNSUPPORTED_OS_MSG');
+         return result;
+       }
+
+       try
+       {
+         result = system.run('checkforrunningvms') == '1';
+       } catch (e) { system.log(e); }
+
+       if(result)
+       {
+         my.result.type = 'Fatal';
+         my.result.title = system.localizedString('RUNNING_VMS_TLE');
+         my.result.message = system.localizedString('RUNNING_VMS_MSG');
+       }
+       return result;
+    }
+    /* js:pkmk:end */
+    </script>
+    <background file="background.tif" alignment="topleft" scaling="none"/>
+    <welcome file="Welcome.html"/>
+    <license file="License.rtf"/>
+    <conclusion file="Conclusion.html"/>
+    <choices-outline>
+        <line choice="choiceVBoxKEXTs"></line>
+        <line choice="choiceVBoxStartup"></line>
+        <line choice="choiceVBox"></line>
+        <line choice="choiceVBoxCLI"></line>
+    </choices-outline>
+    <choice id="choiceVBoxKEXTs" title="choiceVBoxKEXTs_title" description="choiceVBoxKEXTs_msg" start_selected="true" start_enabled="false" start_visible="true">
+        <pkg-ref id="org.virtualbox.pkg.vboxkexts"></pkg-ref>
+    </choice>
+    <choice id="choiceVBoxStartup" title="choiceVBoxStartup_title" description="choiceVBoxStartup_msg" start_selected="true" start_enabled="false" start_visible="true">
+        <pkg-ref id="org.virtualbox.pkg.vboxstartupitems"></pkg-ref>
+    </choice>
+    <choice id="choiceVBox" title="choiceVBox_title" description="choiceVBox_msg" start_selected="true" start_enabled="false" start_visible="true">
+        <pkg-ref id="org.virtualbox.pkg.virtualbox"></pkg-ref>
+    </choice>
+    <choice id="choiceVBoxCLI" title="choiceVBoxCLI_title" description="choiceVBoxCLI_msg" start_selected="true" start_enabled="true" start_visible="true">
+        <pkg-ref id="org.virtualbox.pkg.virtualboxcli"></pkg-ref>
+    </choice>
+    <pkg-ref id="org.virtualbox.pkg.vboxkexts" auth="Root">file:./Contents/Packages/VBoxKEXTs.pkg</pkg-ref>
+    <pkg-ref id="org.virtualbox.pkg.vboxstartupitems" auth="Root">file:./Contents/Packages/VBoxStartupItems.pkg</pkg-ref>
+    <pkg-ref id="org.virtualbox.pkg.virtualbox" auth="Root">file:./Contents/Packages/VirtualBox.pkg</pkg-ref>
+    <pkg-ref id="org.virtualbox.pkg.virtualboxcli" auth="Root">file:./Contents/Packages/VirtualBoxCLI.pkg</pkg-ref>
+</installer-gui-script>
