tweak time axis view item text positioning; allow ArdourCanvas::Text to have its...
[ardour.git] / tools / linux_packaging / install.sh
index 43e86b2fb2f1ea8697398ea4216430a311e6071e..b66b6d9dbef26709d5f1ae6156c1d191e7ea9fec 100755 (executable)
@@ -3,14 +3,26 @@
 # Make sure we have a terminal for the user to see and then run
 # the real install script.
 
-if [ -z $WINDOWID ]; then
+# Some systems don't correctly set the PWD when a script is double-clicked,
+# so go ahead and figure out our path and make sure we are in that directory.
+
+SAVED_PWD=$PWD
+PKG_PATH=$(dirname "$(readlink -f "$0")")
+cd "${PKG_PATH}"
+
+# check for an interactive terminal
+# -t fd - Returns true if file descriptor fd is open and refers to a terminal. 
+# fd 1 is stdout
+if [ ! -t 1 ]; then
        if which xterm > /dev/null; then
-               exec xterm -e ./stage2.run
+               exec xterm -e "${PKG_PATH}/.stage2.run"
        elif which gnome-terminal > /dev/null; then
-               exec gnome-terminal -e ./stage2.run
+               exec gnome-terminal -e "${PKG_PATH}/.stage2.run"
        elif which konsole > /dev/null; then
-               exec konsole -e ./stage2.run
+               exec konsole -e "${PKG_PATH}/.stage2.run"
        fi
 else
-       ./stage2.run
+       "${PKG_PATH}/.stage2.run"
 fi
+
+cd "${SAVED_PWD}"