distribution.dist revision 66ab05d147fcb24a5fec1cd3c37a1799db26c804
<?xml version="1.0" encoding="UTF-8"?>
<!--
#
# Copyright (C) 2008-2012 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
-->
<installer-gui-script minSpecVersion="1.0">
<title>VirtualBox_title</title>
<options customize="allow" allow-external-scripts="yes" rootVolumeOnly="true" hostArchitectures="i386"/>
<installation-check script="checkPrerequisite()"></installation-check>
<domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="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); result = false; }
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.6') >= 0);
} catch (e) { system.log(e); result = false; }
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
{
/* Embedded scripts are not available here. So, just do a command
line checking for running VMs instead. */
rcScript = system.run('/bin/sh', '-c', '/bin/ps -e | /usr/bin/grep -E "VirtualBoxVM.*startvm|VBoxNetDHCP|VBoxNetNAT" | /usr/bin/grep -qv grep');
result = (rcScript != 0);
} catch (e) { system.log(e); result = false; }
if (!result)
{
my.result.type = 'Fatal';
my.result.title = system.localizedString('RUNNING_VMS_TLE');
my.result.message = system.localizedString('RUNNING_VMS_MSG');
return result;
}
system.log("result:" + result);
return result;
}
/* js:pkmk:end */
</script>
<choices-outline>
<line choice="choiceVBoxKEXTs"></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">
</choice>
<choice id="choiceVBox" title="choiceVBox_title" description="choiceVBox_msg" start_selected="true" start_enabled="false" start_visible="true">
</choice>
<choice id="choiceVBoxCLI" title="choiceVBoxCLI_title" description="choiceVBoxCLI_msg" start_selected="true" start_enabled="true" start_visible="true">
</choice>
<pkg-ref id="org.virtualbox.pkg.vboxkexts" auth="Root">file:/Contents/Packages/VBoxKEXTs.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>