check if VBoxManage executes

This commit is contained in:
img2tab
2019-03-06 04:37:18 +00:00
committed by GitHub
parent 1815626f33
commit a63e85c6a6
+6 -6
View File
@@ -90,18 +90,18 @@ fi
# VirtualBox in ${PATH} # VirtualBox in ${PATH}
if [ -z "$(VBoxManage -v 2>/dev/null)" ]; then if [ -z "$(VBoxManage -v 2>/dev/null)" ]; then
if [ -x '/mnt/c/Program Files/Oracle/VirtualBox/VBoxManage.exe' ]; then if [ -n "$('/mnt/c/Program Files/Oracle/VirtualBox/VBoxManage.exe' -v 2>/dev/null)" ]; then
# If VBoxManage.exe is in the standard install location, use it. # If VBoxManage.exe is in the standard install location, use it.
VBoxManage () { function VBoxManage() {
'/mnt/c/Program Files/Oracle/VirtualBox/VBoxManage.exe' "$@" '/mnt/c/Program Files/Oracle/VirtualBox/VBoxManage.exe' "$@"
} }
elif [ -n "$('/cygdrive/c/Program Files/Oracle/VirtualBox/VBoxManage.exe' -v 2>/dev/null)" ]; then
function VBoxManage() {
'/cygdrive/c/Program Files/Oracle/VirtualBox/VBoxManage.exe' "$@"
}
else else
echo "Please make sure VirtualBox is installed, and that the path to" echo "Please make sure VirtualBox is installed, and that the path to"
echo "the VBoxManage executable is in the PATH variable." echo "the VBoxManage executable is in the PATH variable."
if [ -n "${windows}" ]; then echo -n "VBoxManage is usually installed in"
echo "/cygdrive/c/Program Files/Oracle/VirtualBox"
echo "and can be added with PATH=\"\${PATH}:/cygdrive/c/<...>\""
fi
exit exit
fi fi
fi fi