VirtualBox

Ignore:
Timestamp:
Oct 7, 2013 1:49:09 PM (11 years ago)
Author:
vboxsync
Message:

Moved the kernel extension from /Library/Extensions to /Library/Application Support/VirtualBox to work around new signing requirements for kexts in that directory in 10.9.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/darwin/DiskImage/VirtualBox_Uninstall.tool

    r47894 r48924  
    1 #!/bin/sh
    2 #
     1#!/bin/bash
     2# $Id$
     3## @file
    34# VirtualBox Uninstaller Script.
     5#
     6
    47#
    58# Copyright (C) 2007-2013 Oracle Corporation
     
    4649# Note: Do NOT attempt adding directories or filenames with spaces!
    4750#
    48 my_directories=""
    49 my_files=""
     51declare -a my_directories
     52declare -a my_files
    5053
    5154# Users files first
    52 test -f "${HOME}/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist"  && my_files="$my_files ${HOME}/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist"
    53 
    54 test -d /Library/StartupItems/VirtualBox/          && my_directories="$my_directories /Library/StartupItems/VirtualBox/"
    55 test -d /Library/Receipts/VBoxStartupItems.pkg/    && my_directories="$my_directories /Library/Receipts/VBoxStartupItems.pkg/"
    56 
    57 test -d /Library/Extensions/VBoxDrv.kext/          && my_directories="$my_directories /Library/Extensions/VBoxDrv.kext/"
    58 test -d /Library/Extensions/VBoxUSB.kext/          && my_directories="$my_directories /Library/Extensions/VBoxUSB.kext/"
    59 test -d /Library/Extensions/VBoxNetFlt.kext/       && my_directories="$my_directories /Library/Extensions/VBoxNetFlt.kext/"
    60 test -d /Library/Extensions/VBoxNetAdp.kext/       && my_directories="$my_directories /Library/Extensions/VBoxNetAdp.kext/"
     55test -f "${HOME}/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist"  && my_files+=("${HOME}/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist")
     56
     57test -d /Library/StartupItems/VirtualBox/          && my_directories+=("/Library/StartupItems/VirtualBox/")
     58test -d /Library/Receipts/VBoxStartupItems.pkg/    && my_directories+=("/Library/Receipts/VBoxStartupItems.pkg/")
     59
     60test -d "/Library/Application Support/VirtualBox/VBoxDrv.kext/"     && my_directories+=("/Library/Application Support/VirtualBox/VBoxDrv.kext/")
     61test -d "/Library/Application Support/VirtualBox/VBoxUSB.kext/"     && my_directories+=("/Library/Application Support/VirtualBox/VBoxUSB.kext/")
     62test -d "/Library/Application Support/VirtualBox/VBoxNetFlt.kext/"  && my_directories+=("/Library/Application Support/VirtualBox/VBoxNetFlt.kext/")
     63test -d "/Library/Application Support/VirtualBox/VBoxNetAdp.kext/"  && my_directories+=("/Library/Application Support/VirtualBox/VBoxNetAdp.kext/")
     64# Pre 4.3.0rc1 locations:
     65test -d /Library/Extensions/VBoxDrv.kext/          && my_directories+=("/Library/Extensions/VBoxDrv.kext/")
     66test -d /Library/Extensions/VBoxUSB.kext/          && my_directories+=("/Library/Extensions/VBoxUSB.kext/")
     67test -d /Library/Extensions/VBoxNetFlt.kext/       && my_directories+=("/Library/Extensions/VBoxNetFlt.kext/")
     68test -d /Library/Extensions/VBoxNetAdp.kext/       && my_directories+=("/Library/Extensions/VBoxNetAdp.kext/")
    6169# Tiger support is obsolete, but we leave it here for a clean removing of older
    6270# VirtualBox versions
    63 test -d /Library/Extensions/VBoxDrvTiger.kext/     && my_directories="$my_directories /Library/Extensions/VBoxDrvTiger.kext/"
    64 test -d /Library/Extensions/VBoxUSBTiger.kext/     && my_directories="$my_directories /Library/Extensions/VBoxUSBTiger.kext/"
    65 test -d /Library/Receipts/VBoxKEXTs.pkg/           && my_directories="$my_directories /Library/Receipts/VBoxKEXTs.pkg/"
    66 
    67 test -f /usr/bin/VirtualBox                        && my_files="$my_files /usr/bin/VirtualBox"
    68 test -f /usr/bin/VBoxManage                        && my_files="$my_files /usr/bin/VBoxManage"
    69 test -f /usr/bin/VBoxVRDP                          && my_files="$my_files /usr/bin/VBoxVRDP"
    70 test -f /usr/bin/VBoxHeadless                      && my_files="$my_files /usr/bin/VBoxHeadless"
    71 test -f /usr/bin/vboxwebsrv                        && my_files="$my_files /usr/bin/vboxwebsrv"
    72 test -f /usr/bin/VBoxBalloonCtrl                   && my_files="$my_files /usr/bin/VBoxBalloonCtrl"
    73 test -f /usr/bin/VBoxAutostart                     && my_files="$my_files /usr/bin/VBoxAutostart"
    74 test -f /usr/bin/vbox-img                          && my_files="$my_files /usr/bin/vbox-img"
    75 test -d /Library/Receipts/VirtualBoxCLI.pkg/       && my_directories="$my_directories /Library/Receipts/VirtualBoxCLI.pkg/"
    76 
    77 test -d /Applications/VirtualBox.app/              && my_directories="$my_directories /Applications/VirtualBox.app/"
    78 test -d /Library/Receipts/VirtualBox.pkg/          && my_directories="$my_directories /Library/Receipts/VirtualBox.pkg/"
     71test -d /Library/Extensions/VBoxDrvTiger.kext/     && my_directories+=("/Library/Extensions/VBoxDrvTiger.kext/")
     72test -d /Library/Extensions/VBoxUSBTiger.kext/     && my_directories+=("/Library/Extensions/VBoxUSBTiger.kext/")
     73test -d /Library/Receipts/VBoxKEXTs.pkg/           && my_directories+=("/Library/Receipts/VBoxKEXTs.pkg/")
     74
     75test -f /usr/bin/VirtualBox                        && my_files+=("/usr/bin/VirtualBox")
     76test -f /usr/bin/VBoxManage                        && my_files+=("/usr/bin/VBoxManage")
     77test -f /usr/bin/VBoxVRDP                          && my_files+=("/usr/bin/VBoxVRDP")
     78test -f /usr/bin/VBoxHeadless                      && my_files+=("/usr/bin/VBoxHeadless")
     79test -f /usr/bin/vboxwebsrv                        && my_files+=("/usr/bin/vboxwebsrv")
     80test -f /usr/bin/VBoxBalloonCtrl                   && my_files+=("/usr/bin/VBoxBalloonCtrl")
     81test -f /usr/bin/VBoxAutostart                     && my_files+=("/usr/bin/VBoxAutostart")
     82test -f /usr/bin/vbox-img                          && my_files+=("/usr/bin/vbox-img")
     83test -d /Library/Receipts/VirtualBoxCLI.pkg/       && my_directories+=("/Library/Receipts/VirtualBoxCLI.pkg/")
     84
     85test -d /Applications/VirtualBox.app/              && my_directories+=("/Applications/VirtualBox.app/")
     86test -d /Library/Receipts/VirtualBox.pkg/          && my_directories+=("/Library/Receipts/VirtualBox.pkg/")
    7987
    8088# legacy
    81 test -d /Library/Receipts/VBoxDrv.pkg/             && my_directories="$my_directories /Library/Receipts/VBoxDrv.pkg/"
    82 test -d /Library/Receipts/VBoxUSB.pkg/             && my_directories="$my_directories /Library/Receipts/VBoxUSB.pkg/"
     89test -d /Library/Receipts/VBoxDrv.pkg/             && my_directories+=("/Library/Receipts/VBoxDrv.pkg/")
     90test -d /Library/Receipts/VBoxUSB.pkg/             && my_directories+=("/Library/Receipts/VBoxUSB.pkg/")
    8391
    8492# python stuff
    8593python_versions="2.3 2.5 2.6 2.7"
    8694for p in $python_versions; do
    87     test -f /Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.py  && my_files="$my_files /Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.py"
    88     test -f /Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.pyc && my_files="$my_files /Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.pyc"
    89     test -f /Library/Python/$p/site-packages/vboxapi/__init__.py              && my_files="$my_files /Library/Python/$p/site-packages/vboxapi/__init__.py"
    90     test -f /Library/Python/$p/site-packages/vboxapi/__init__.pyc             && my_files="$my_files /Library/Python/$p/site-packages/vboxapi/__init__.pyc"
    91     test -f /Library/Python/$p/site-packages/vboxapi-1.0-py$p.egg-info        && my_files="$my_files /Library/Python/$p/site-packages/vboxapi-1.0-py$p.egg-info"
    92     test -d /Library/Python/$p/site-packages/vboxapi/                         && my_directories="$my_directories /Library/Python/$p/site-packages/vboxapi/"
     95    test -f /Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.py  && my_files+=("/Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.py")
     96    test -f /Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.pyc && my_files+=("/Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.pyc")
     97    test -f /Library/Python/$p/site-packages/vboxapi/__init__.py              && my_files+=("/Library/Python/$p/site-packages/vboxapi/__init__.py")
     98    test -f /Library/Python/$p/site-packages/vboxapi/__init__.pyc             && my_files+=("/Library/Python/$p/site-packages/vboxapi/__init__.pyc")
     99    test -f /Library/Python/$p/site-packages/vboxapi-1.0-py$p.egg-info        && my_files+=("/Library/Python/$p/site-packages/vboxapi-1.0-py$p.egg-info")
     100    test -d /Library/Python/$p/site-packages/vboxapi/                         && my_directories+=("/Library/Python/$p/site-packages/vboxapi/")
    93101done
    94102
     
    97105# Note that the unload order is significant.
    98106#
    99 my_kexts=""
     107declare -a my_kexts
    100108for kext in org.virtualbox.kext.VBoxUSB org.virtualbox.kext.VBoxNetFlt org.virtualbox.kext.VBoxNetAdp org.virtualbox.kext.VBoxDrv; do
    101109    if /usr/sbin/kextstat -b $kext -l | grep -q $kext; then
    102         my_kexts="$my_kexts $kext"
     110        my_kexts+=("$kext")
    103111    fi
    104112done
     
    113121# Did we find anything to uninstall?
    114122#
    115 if test -z "$my_directories"  -a  -z "$my_files"   -a  -z "$my_kexts"  -a  -z "$my_pkgs"; then
     123if test -z "${my_directories[*]}"  -a  -z "${my_files[*]}"   -a  -z "${my_kexts[*]}"  -a  -z "$my_pkgs"; then
    116124    echo "No VirtualBox files, directories, KEXTs or packages to uninstall."
    117125    echo "Done."
     
    151159# and get the user's consent before continuing.
    152160#
    153 if test -n "$my_files"  -o  -n "$my_directories"; then
     161if test -n "${my_files[*]}"  -o  -n "${my_directories[*]}"; then
    154162    echo "The following files and directories (bundles) will be removed:"
    155     for file in $my_files;       do echo "    $file"; done
    156     for dir  in $my_directories; do echo "    $dir"; done
    157 fi
    158 if test -n "$my_kexts"; then
     163    for file in "${my_files[@]}";       do echo "    $file"; done
     164    for dir  in "${my_directories[@]}"; do echo "    $dir"; done
     165    echo ""
     166fi
     167if test -n "${my_kexts[*]}"; then
    159168    echo "And the following KEXTs will be unloaded:"
    160     for kext in $my_kexts;       do echo "    $kext"; done
     169    for kext in "${my_kexts[@]}";       do echo "    $kext"; done
     170    echo ""
    161171fi
    162172if test -n "$my_pkgs"; then
    163173    echo "And the traces of following packages will be removed:"
    164174    for kext in $my_pkgs;       do echo "    $kext"; done
    165 fi
    166 echo ""
     175    echo ""
     176fi
    167177
    168178if test "$my_default_prompt" != "Yes"; then
     
    193203echo ""
    194204
    195 if test -n "$my_files"  -o  -n "$my_directories"; then
    196     /usr/bin/sudo -p "Please enter %u's password:" /bin/rm -Rf $my_files $my_directories
     205if test -n "${my_files[*]}"  -o  -n "${my_directories[*]}"; then
     206    /usr/bin/sudo -p "Please enter %u's password:" /bin/rm -Rf "${my_files[@]}" "${my_directories[@]}"
    197207    my_rc=$?
    198208    if test "$my_rc" -ne 0; then
     
    207217
    208218my_rc=0
    209 for kext in $my_kexts; do
     219for kext in "${my_kexts[@]}"; do
    210220    echo unloading $kext
    211221    /usr/bin/sudo -p "Please enter %u's password (unloading $kext):" /sbin/kextunload -m $kext
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette