diff options
Diffstat (limited to 'src/VBox/Installer/darwin/VirtualBox/preflight')
-rwxr-xr-x | src/VBox/Installer/darwin/VirtualBox/preflight | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/VBox/Installer/darwin/VirtualBox/preflight b/src/VBox/Installer/darwin/VirtualBox/preflight new file mode 100755 index 00000000..d5262eba --- /dev/null +++ b/src/VBox/Installer/darwin/VirtualBox/preflight @@ -0,0 +1,41 @@ +#!/bin/sh + +# +# Copyright (C) 2007-2022 Oracle and/or its affiliates. +# +# This file is part of VirtualBox base platform packages, as +# available from https://www.virtualbox.org. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, in version 3 of the +# License. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <https://www.gnu.org/licenses>. +# +# SPDX-License-Identifier: GPL-3.0-only +# + +set -e + +# Check environment. +if [ "x${INSTALLER_TEMP}" = "x" ]; then + echo "Required environment variable INSTALLER_TEMP is missing. Aborting installation." + exit 1; +fi + +# Backup previously installed Extension Packs before +# installation process will completely remove previously installed +# VirtualBox distribution. +EXTPACKS_ROOT_PATH="/Applications/VirtualBox.app/Contents/MacOS/ExtensionPacks" +if [ -d "${EXTPACKS_ROOT_PATH}" ]; then + cp -r "${EXTPACKS_ROOT_PATH}" "${INSTALLER_TEMP}" +fi + +exit 0; |