The installer will now create a link to the program in /usr/local/bin to allow starting from the command line. If the installer or uninstaller is not running as root, they will now attempt to use both sudo and su to get root access. This means double click install now works on systems that don't have sudo installed or configured.
git-svn-id: svn://localhost/ardour2/branches/3.0@11553 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8de887f378
commit
a3eaff8fa3
@ -7,10 +7,9 @@ to the folder and run:
|
||||
|
||||
./install.sh
|
||||
|
||||
The installer will ask for your root password (sudo), and copy the
|
||||
The installer will ask for your root password (sudo/su), and copy the
|
||||
contents of the appropriate bundle (32-bit or 64-bit) to your /opt
|
||||
folder. If your distro does not provide sudo, then run install.sh
|
||||
as root (su -c ./install.sh).
|
||||
folder.
|
||||
|
||||
|
||||
* Links and Menu entries:
|
||||
@ -23,8 +22,8 @@ In addition to installing the program, the installer will create:
|
||||
|
||||
* Uninstaller:
|
||||
|
||||
To uninstall Ardour, run the uninstaller script in the /opt folder
|
||||
(as root). This will remove the app, desktop links, menu links, and
|
||||
To uninstall Ardour, run the uninstaller script in the /opt folder.
|
||||
This will remove the app, desktop links, menu links, and
|
||||
the uninstaller itself.
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ PGM_VENDOR="Ardour"
|
||||
PGM_EXEC_FILE="ardour3"
|
||||
|
||||
INSTALL_DEST_BASE="/opt"
|
||||
USER_BIN_DIR="/usr/local/bin"
|
||||
|
||||
PGM_NAME_LOWER=$(echo $PGM_NAME | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
@ -138,31 +139,49 @@ if [ "$(id -u)" != "0" ]; then
|
||||
if ! which sudo > /dev/null;
|
||||
then
|
||||
echo ""
|
||||
echo "!!! ERROR !!!"
|
||||
echo "Sudo installed failed, attempting to install using su"
|
||||
echo "Please enter root password below"
|
||||
echo ""
|
||||
echo "This installer requires root privileges. It is currently not"
|
||||
echo "running as root AND the program sudo is missing from this system."
|
||||
echo ""
|
||||
echo "Please correct this by installing and configuring sudo or running"
|
||||
echo "the installer as root (su -c)."
|
||||
echo ""
|
||||
read -p "Press ENTER to exit installer:" BLAH
|
||||
exit 1
|
||||
|
||||
if ! su -c "./.stage2.run";
|
||||
then
|
||||
echo ""
|
||||
echo "!!! ERROR !!!"
|
||||
echo ""
|
||||
echo "This installer requires root privileges. It is currently not"
|
||||
echo "running as root AND an attempt to use su failed."
|
||||
echo ""
|
||||
echo "Please correct this by installing and configuring sudo or running"
|
||||
echo "the installer as root (su -c)."
|
||||
echo ""
|
||||
read -p "Press ENTER to exit installer:" BLAH
|
||||
exit 1
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
|
||||
if ! sudo date;
|
||||
then
|
||||
echo ""
|
||||
echo "!!! ERROR !!!"
|
||||
echo "Attempting to install using su"
|
||||
echo "Please enter root password below"
|
||||
echo ""
|
||||
echo "This installer requires root privileges. It is currently not"
|
||||
echo "running as root AND an attempt to use sudo failed."
|
||||
echo ""
|
||||
echo "Please correct this by installing and configuring sudo or running"
|
||||
echo "the installer as root (su -c)."
|
||||
echo ""
|
||||
read -p "Press ENTER to exit installer:" BLAH
|
||||
exit 1
|
||||
|
||||
if ! su -c "./.stage2.run";
|
||||
then
|
||||
echo ""
|
||||
echo "!!! ERROR !!!"
|
||||
echo ""
|
||||
echo "This installer requires root privileges. It is currently not"
|
||||
echo "running as root AND an attempt to use both sudo and su failed."
|
||||
echo ""
|
||||
echo "Please correct this by installing and configuring sudo or running"
|
||||
echo "the installer as root (su -c)."
|
||||
echo ""
|
||||
read -p "Press ENTER to exit installer:" BLAH
|
||||
exit 1
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
SUPER="sudo"
|
||||
|
||||
@ -451,6 +470,25 @@ echo ""
|
||||
|
||||
${SUPER} cp -f ${BUNDLE_DIR}/bin/*.uninstall.sh ${INSTALL_DEST_BASE}/.
|
||||
|
||||
# Create link to the program in user bin
|
||||
|
||||
echo ""
|
||||
echo "Creating link ${PGM_NAME}3 in ${USER_BIN_DIR}"
|
||||
echo ""
|
||||
|
||||
if [ -d "${USER_BIN_DIR}" ]; then
|
||||
if [ -e "${USER_BIN_DIR}/${PGM_NAME}3" ]; then
|
||||
${SUPER} rm -f ${USER_BIN_DIR}/${PGM_NAME}3
|
||||
fi
|
||||
|
||||
cd "${USER_BIN_DIR}"
|
||||
${SUPER} ln -sf ${PGM_EXEC_PATH} ${PGM_NAME}3
|
||||
cd "${PKG_PATH}"
|
||||
|
||||
else
|
||||
echo "Can not create link because ${USER_BIN_DIR} does not exist"
|
||||
fi
|
||||
|
||||
###########################
|
||||
# Check Jack and qjackctl
|
||||
###########################
|
||||
|
@ -15,6 +15,9 @@ PGM_BUILD="%REPLACE_BUILD%"
|
||||
PGM_BUILDTYPE="%REPLACE_TYPE%"
|
||||
|
||||
INSTALL_DEST_BASE=/opt
|
||||
USER_BIN_DIR="/usr/local/bin"
|
||||
|
||||
UNINSTALLER="$(readlink -f "$0")"
|
||||
|
||||
USER_NAME=$(logname)
|
||||
|
||||
@ -46,29 +49,49 @@ if [ "$(id -u)" != "0" ]; then
|
||||
if ! which sudo > /dev/null;
|
||||
then
|
||||
echo ""
|
||||
echo "!!! ERROR !!!"
|
||||
echo "Attempting to uninstall using su"
|
||||
echo "Please enter root password below"
|
||||
echo ""
|
||||
echo "The uninstaller requires root privileges. It is currently not"
|
||||
echo "running as root AND the program sudo is missing from this system."
|
||||
echo ""
|
||||
echo "Please correct this by running the uninstaller as root or"
|
||||
echo "installing and configuring sudo."
|
||||
echo ""
|
||||
read -p "Press ENTER to exit uninstaller:" BLAH
|
||||
exit 1
|
||||
|
||||
if ! su -c "${UNINSTALLER}";
|
||||
then
|
||||
echo ""
|
||||
echo "!!! ERROR !!!"
|
||||
echo ""
|
||||
echo "This uninstaller requires root privileges. It is currently not"
|
||||
echo "running as root AND an attempt to use su failed."
|
||||
echo ""
|
||||
echo "Please correct this by installing and configuring sudo or running"
|
||||
echo "the uninstaller as root (su -c)."
|
||||
echo ""
|
||||
read -p "Press ENTER to exit uninstaller:" BLAH
|
||||
exit 1
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
|
||||
if ! sudo date;
|
||||
then
|
||||
echo ""
|
||||
echo "!!! ERROR !!!"
|
||||
echo "Attempting to uninstall using su"
|
||||
echo "Please enter root password below"
|
||||
echo ""
|
||||
echo "Either you don't know the root password or the user is not allowed to sudo"
|
||||
echo "Please correct this and run the uninstaller again"
|
||||
echo "(hint: use visudo to edit sudoers file or run the installer as root)"
|
||||
echo ""
|
||||
read -p "Press ENTER to exit uninstaller:" BLAH
|
||||
exit 1
|
||||
|
||||
if ! su -c "${UNINSTALLER}";
|
||||
then
|
||||
echo ""
|
||||
echo "!!! ERROR !!!"
|
||||
echo ""
|
||||
echo "This uninstaller requires root privileges. It is currently not"
|
||||
echo "running as root AND an attempt to use both sudo and su failed."
|
||||
echo ""
|
||||
echo "Please correct this by installing and configuring sudo or running"
|
||||
echo "the uninstaller as root (su -c)."
|
||||
echo ""
|
||||
read -p "Press ENTER to exit uninstaller:" BLAH
|
||||
exit 1
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
SUPER="sudo"
|
||||
fi
|
||||
@ -135,6 +158,19 @@ then
|
||||
${SUPER} rm -f ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
|
||||
fi
|
||||
|
||||
# delete the bin link if it is linked to this version
|
||||
if [ -e "${USER_BIN_DIR}/${PGM_NAME}3" ];
|
||||
then
|
||||
BIN_LINK_TARGET=$(readlink "${USER_BIN_DIR}/${PGM_NAME}3")
|
||||
BIN_LINK_TARGET_DIR=$(dirname "${BIN_LINK_TARGET}")
|
||||
|
||||
if [ "${BIN_LINK_TARGET_DIR}" = "${PGM_PATH}/bin" ];
|
||||
then
|
||||
${SUPER} rm -f "${USER_BIN_DIR}/${PGM_NAME}3"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# delete the old package
|
||||
${SUPER} rm -rf ${PGM_PATH}
|
||||
${SUPER} rm -f $0
|
||||
|
Loading…
Reference in New Issue
Block a user