fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync<?xml version="1.0" encoding="UTF-8"?>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync<!--
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync#
9b78d876af0c758e488aaeffbd939a55afde982avboxsync# Copyright (C) 2008-2014 Oracle Corporation
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync#
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# available from http://www.virtualbox.org. This file is free software;
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# you can redistribute it and/or modify it under the terms of the GNU
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# General Public License (GPL) as published by the Free Software
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
343053a42dedb94c8ef5534fff89c72384adf94dvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync#
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync-->
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync<installer-gui-script minSpecVersion="1.0">
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <title>VirtualBox_title</title>
a9ceb1b76f2372385c1477c4bbdc5ceeb45f1d2cvboxsync <options customize="allow" allow-external-scripts="yes" rootVolumeOnly="true" hostArchitectures="i386"/>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <installation-check script="checkPrerequisite()"></installation-check>
a9ceb1b76f2372385c1477c4bbdc5ceeb45f1d2cvboxsync <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <script>
5762cd6c4b938db5e541d35f5e9d2adf5b56a81dvboxsync//<![CDATA[
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync /* js:pkmk:start */
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync function checkPrerequisite()
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync {
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync try
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync {
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync test = system.sysctl('hw.machine');
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync system.log("Hardware architecture detected: " + test);
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync result = (test == 'i386' || test == 'x86_64');
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync } catch (e) { system.log(e); result = false; }
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync if (!result)
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync {
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync my.result.type = 'Fatal';
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync my.result.title = system.localizedString('UNSUPPORTED_HW_MACHINE_TLE');
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync my.result.message = system.localizedString('UNSUPPORTED_HW_MACHINE_MSG');
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync return result;
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync }
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync try
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync {
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync test = system.version['ProductVersion'];
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync system.log("OS version detected: " + test);
629429ccab75e7f0d7d6a8991294e305819bf31avboxsync result = (system.compareVersions(test, '10.6') >= 0);
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync } catch (e) { system.log(e); result = false; }
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync if (!result)
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync {
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync my.result.type = 'Fatal';
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync my.result.title = system.localizedString('UNSUPPORTED_OS_TLE');
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync my.result.message = system.localizedString('UNSUPPORTED_OS_MSG');
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync return result;
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync }
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync
9b78d876af0c758e488aaeffbd939a55afde982avboxsync try
9b78d876af0c758e488aaeffbd939a55afde982avboxsync {
9b78d876af0c758e488aaeffbd939a55afde982avboxsync /* The following shell script uses tools which were added in 10.8
9b78d876af0c758e488aaeffbd939a55afde982avboxsync (Mountain Lion) and later, in particular pgrep and pkill. */
9b78d876af0c758e488aaeffbd939a55afde982avboxsync if (system.compareVersions(system.version['ProductVersion'], '10.8') >= 0)
9b78d876af0c758e488aaeffbd939a55afde982avboxsync {
9b78d876af0c758e488aaeffbd939a55afde982avboxsync /* Embedded scripts are not available here. So, just do a
9b78d876af0c758e488aaeffbd939a55afde982avboxsync command line checking if any VBoxXPCOMIPCD has more than one
9b78d876af0c758e488aaeffbd939a55afde982avboxsync client, and if there are none, kill all the usual suspects to
9b78d876af0c758e488aaeffbd939a55afde982avboxsync get a clean slate. This is done because the VirtualBox event
9b78d876af0c758e488aaeffbd939a55afde982avboxsync handling had a bug which allowed no longer present passive
9b78d876af0c758e488aaeffbd939a55afde982avboxsync event listeners to block VBoxSVC processes from exiting until
9b78d876af0c758e488aaeffbd939a55afde982avboxsync the waiting time was elapsed. In the extreme case this was
9b78d876af0c758e488aaeffbd939a55afde982avboxsync infinitely long, blocking updates. */
198910cda1ebfbcde2b759584a7dbcc3fdf273f8vboxsync system.run('/bin/sh', '-c', 'pids=`/usr/bin/pgrep VBoxXPCOMIPCD` rc=0; [ -z "$pids" ] && rc=1; for i in $pids; do c=`/usr/sbin/lsof -p $i | /usr/bin/grep -E \'^[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +unix\' | wc -l`; [ $c -le 2 ] || rc=1; done; if [ $rc -eq 0 ]; then /usr/bin/pkill -KILL \'^(VirtualBox)|(VBoxNetDHCP)|(VBoxNetNAT)|(VBoxHeadless)|(VBoxXPCOMIPCD)|(VBoxSVC)$\'; sleep 1; fi');
9b78d876af0c758e488aaeffbd939a55afde982avboxsync }
9b78d876af0c758e488aaeffbd939a55afde982avboxsync } catch (e) { system.log(e); }
9b78d876af0c758e488aaeffbd939a55afde982avboxsync
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync try
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync {
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync /* Embedded scripts are not available here. So, just do a command
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync line checking for running VMs instead. */
a7827f56ece30614538d1121cec2373aabb695d0vboxsync rcScript = system.run('/bin/sh', '-c', '/bin/ps -e | /usr/bin/grep -E \'[V]irtualBox.*startvm|[V]BoxNetDHCP|[V]BoxNetNAT|[V]BoxHeadless|[V]BoxSVC\'');
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync result = (rcScript != 0);
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync system.log("system.run /bin/sh .. returned: " + rcScript + " result=" + result);
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync } catch (e) { system.log(e); result = false; }
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync if (!result)
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync {
198910cda1ebfbcde2b759584a7dbcc3fdf273f8vboxsync /* Temporary instrumentation for finding out with some probability
198910cda1ebfbcde2b759584a7dbcc3fdf273f8vboxsync * who keeps VBoxSVC busy (unix socket to VBoxXPCOMIPCD open). Needs
198910cda1ebfbcde2b759584a7dbcc3fdf273f8vboxsync * very little time (unlike a full lsof) and causes bearable amount
198910cda1ebfbcde2b759584a7dbcc3fdf273f8vboxsync * of messages to install.log so that it can stay in for a while. */
198910cda1ebfbcde2b759584a7dbcc3fdf273f8vboxsync try
198910cda1ebfbcde2b759584a7dbcc3fdf273f8vboxsync {
198910cda1ebfbcde2b759584a7dbcc3fdf273f8vboxsync system.run('/usr/sbin/lsof', '-l', '-U');
198910cda1ebfbcde2b759584a7dbcc3fdf273f8vboxsync } catch (e) { system.log(e); }
198910cda1ebfbcde2b759584a7dbcc3fdf273f8vboxsync
9c75fb45ee506229edd8f431ea22ac401dd29b9bvboxsync my.result.type = 'Fatal';
9c75fb45ee506229edd8f431ea22ac401dd29b9bvboxsync my.result.title = system.localizedString('RUNNING_VMS_TLE');
9c75fb45ee506229edd8f431ea22ac401dd29b9bvboxsync my.result.message = system.localizedString('RUNNING_VMS_MSG');
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync return result;
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync }
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync
e521c29e0b5c1e5d6adab4a0c61b4ed4479e5cfavboxsync system.log("result:" + result);
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync return result;
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync }
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync /* js:pkmk:end */
5762cd6c4b938db5e541d35f5e9d2adf5b56a81dvboxsync//]]>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync </script>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <background file="background.tif" alignment="topleft" scaling="none"/>
a9ceb1b76f2372385c1477c4bbdc5ceeb45f1d2cvboxsync <welcome file="Welcome.rtf" mime-type="text/rtf" uti="public.rtf"/>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <choices-outline>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <line choice="choiceVBoxKEXTs"></line>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <line choice="choiceVBox"></line>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <line choice="choiceVBoxCLI"></line>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync </choices-outline>
a9ceb1b76f2372385c1477c4bbdc5ceeb45f1d2cvboxsync <choice id="choiceVBoxKEXTs" title="choiceVBoxKEXTs_title" description="choiceVBoxKEXTs_msg" start_selected="true" start_enabled="false" start_visible="true">
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <pkg-ref id="org.virtualbox.pkg.vboxkexts"></pkg-ref>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync </choice>
a9ceb1b76f2372385c1477c4bbdc5ceeb45f1d2cvboxsync <choice id="choiceVBox" title="choiceVBox_title" description="choiceVBox_msg" start_selected="true" start_enabled="false" start_visible="true">
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <pkg-ref id="org.virtualbox.pkg.virtualbox"></pkg-ref>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync </choice>
a9ceb1b76f2372385c1477c4bbdc5ceeb45f1d2cvboxsync <choice id="choiceVBoxCLI" title="choiceVBoxCLI_title" description="choiceVBoxCLI_msg" start_selected="true" start_enabled="true" start_visible="true">
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <pkg-ref id="org.virtualbox.pkg.virtualboxcli"></pkg-ref>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync </choice>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <pkg-ref id="org.virtualbox.pkg.vboxkexts" auth="Root">file:/Contents/Packages/VBoxKEXTs.pkg</pkg-ref>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <pkg-ref id="org.virtualbox.pkg.virtualbox" auth="Root">file:/Contents/Packages/VirtualBox.pkg</pkg-ref>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync <pkg-ref id="org.virtualbox.pkg.virtualboxcli" auth="Root">file:/Contents/Packages/VirtualBoxCLI.pkg</pkg-ref>
fb27aa740466280f820e13e238bc6dd0b477eb37vboxsync</installer-gui-script>
a9ceb1b76f2372385c1477c4bbdc5ceeb45f1d2cvboxsync