3 ######################################
5 # Ardour/Mixbus bundle uninstaller
8 #####################################
11 PGM_NAME="%REPLACE_PGM%"
12 PGM_VENDOR="%REPLACE_VENDOR%"
13 PGM_VERSION="%REPLACE_VERSION%"
14 PGM_BUILD="%REPLACE_BUILD%"
15 PGM_BUILDTYPE="%REPLACE_TYPE%"
17 INSTALL_DEST_BASE=/opt
20 #### Derived Variables ####
21 if [ -z "${PGM_BUILDTYPE}" ]; then
22 PGM_PATH=${INSTALL_DEST_BASE}/${PGM_NAME}-${PGM_VERSION}_${PGM_BUILD}
23 ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}" #no dash between name and version since dash seperates vendor from program
24 MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}.desktop" #no dash between name and version since dash seperates vendor from program
25 DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}.desktop"
27 PGM_PATH=${INSTALL_DEST_BASE}/${PGM_NAME}-${PGM_VERSION}_${PGM_BUILD}-${PGM_BUILDTYPE}
28 ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}" #no dash between name and version since dash seperates vendor from program
29 MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop" #no dash between name and version since dash seperates vendor from program
30 DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop"
33 MENU_FILE_PATH="${PGM_PATH}/share/${MENU_FILE}"
36 #############################
37 # Check for root privileges
38 #############################
42 if [ "$(id -u)" != "0" ]; then
44 if ! which sudo > /dev/null;
49 echo "The uninstaller requires root privileges. It is currently not"
50 echo "running as root AND the program sudo is missing from this system."
52 echo "Please correct this by running the uninstaller as root or"
53 echo "installing and configuring sudo."
55 read -p "Press ENTER to exit uninstaller:" BLAH
64 echo "Either you don't know the root password or the user is not allowed to sudo"
65 echo "Please correct this and run the uninstaller again"
66 echo "(hint: use visudo to edit sudoers file or run the installer as root)"
68 read -p "Press ENTER to exit uninstaller:" BLAH
74 #######################
76 #######################
79 XDG_MENU_VER=$(xdg-desktop-menu --version 2> /dev/null)
80 if [ -z "$XDG_MENU_VER" ];
82 echo "System does not have xdg-desktop-menu installed"
86 XDG_ICON_VER=$(xdg-icon-resource --version 2> /dev/null)
87 if [ -z "$XDG_ICON_VER" ];
89 echo "System does not have xdg-icon-resource installed"
98 if [ -d ${PGM_PATH} ];
101 echo "Removing existing ${PGM_NAME} installation at ${PGM_PATH}"
104 if [ "T" = ${HAS_XDG} ];
106 ${SUPER} xdg-desktop-menu uninstall ${MENU_FILE_PATH}
107 ${SUPER} xdg-icon-resource uninstall --size 16 ${ICON_NAME}
108 ${SUPER} xdg-icon-resource uninstall --size 22 ${ICON_NAME}
109 ${SUPER} xdg-icon-resource uninstall --size 32 ${ICON_NAME}
110 ${SUPER} xdg-icon-resource uninstall --size 48 ${ICON_NAME}
112 if [ -e /usr/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg ];
114 ${SUPER} rm -f /usr/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg
118 if [ -e ~/Desktop/${DESKTOP_LINK_FILE} ];
120 ${SUPER} rm -f ~/Desktop/${DESKTOP_LINK_FILE}
123 # delete the old package
124 ${SUPER} rm -rf ${PGM_PATH}
128 echo "!!! FAILURE !!! - install path ${PGM_PATH} does not exist."