VirtualBox

Ignore:
Timestamp:
Jul 7, 2020 9:51:37 PM (5 years ago)
Author:
vboxsync
Message:

Installer/darwin: bugref:9771 Improve error handling when installing vboxwebsrv plist file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/darwin/VirtualBox/postflight

    r83054 r85100  
    1717#
    1818
    19 CP="/bin/cp -f"
    20 CPDIR="${CP} -R"
     19CPDIR="/bin/cp -f -R"
     20INSTALL=/usr/bin/install
    2121
    2222
     
    4444VBOXWEBSRV="${VBOX_INSTALL_PATH}/org.virtualbox.vboxwebsrv.plist"
    4545VBOXWEBSRV_TRG="${HOME}/Library/LaunchAgents"
    46 if [[ -e "${VBOXWEBSRV}" && -e "${VBOXWEBSRV_TRG}" ]]; then
     46if [ -e "${VBOXWEBSRV}" -a -e "${VBOXWEBSRV_TRG}" ]; then
    4747    echo "Installing vboxwebsrv launchd file to ${VBOXWEBSRV_TRG}"
    48     ${CP} "${VBOXWEBSRV}" "${VBOXWEBSRV_TRG}/"
    49     [ "x" != "x${USER}" ] && /usr/sbin/chown "${USER}" "${VBOXWEBSRV_TRG}/org.virtualbox.vboxwebsrv.plist"
     48    if [ "x" != "x${USER}" ]; then
     49        ${INSTALL} -S -o "${USER}" -m 0644 "${VBOXWEBSRV}" "${VBOXWEBSRV_TRG}/"
     50    else
     51        ${INSTALL} -S -m 0644 "${VBOXWEBSRV}" "${VBOXWEBSRV_TRG}/"
     52    fi
    5053fi
    5154
     
    6366#
    6467LSREGISTER=/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister
    65 if [[ -e "${LSREGISTER}" && "x" != "x${USER}" ]]; then
     68if [ -e "${LSREGISTER}" -a "x" != "x${USER}" ]; then
    6669    echo "Register file extensions for \"${USER}\""
    6770    /usr/bin/sudo -u "${USER}" ${LSREGISTER} -f /Applications/VirtualBox.app
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