A new version that detects the terminal by the desktop.

Code:
--- install	2005-12-20 13:11:44.000000000 -0500
+++ install.xterm	2006-01-05 13:30:38.000000000 -0500
@@ -81,6 +81,31 @@
  esac
 }
 
+export NATIVEXVT=rxvt
+if [ "$DIALOG" = "kdialog" ]
+then
+  export NATIVEXVT="konsole --nomenubar --notabbar --noframe --noscrollbar"
+elif [ "$DIALOG" = "zenity" ]
+then
+  export NATIVEXVT="gnome-terminal --hide-menubar"
+fi
+
+unset XVT
+# Determine what X virtual terminal to use (if applicable)
+if [ "$DISPLAY" -a "`tty | grep not`" ]
+then
+  for i in xterm \
+        rxvt \
+        "$NATIVEXVT"
+  do
+    $i --help
+    if [ "$?" != "127" ]
+    then
+      export XVT="$i -e"
+    fi
+  done
+fi
+
 cat > $HOME/.klik <<\EOF
 #!/bin/bash
 
@@ -511,8 +536,25 @@
 fi
 EOF
 chmod 777 "$HOME/klik-cmg-install-root"
+cat > "$HOME/klik-prompt-root" <<EOF
+#!/bin/bash
+echo Please enter your root password:
+su -c "$HOME/klik-cmg-install-root"
+EOF
+chmod 777 "$HOME/klik-prompt-root"
+
+# Try su'ing to root
+$XVT $HOME/klik-prompt-root
+rm -f "$HOME/klik-prompt-root"
+
+# If that didn't work, just tell the user what to do
+if [ -z "$(cat /etc/fstab | grep app/7)" ]
+then
+  dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root."
+else
+  rm -f "$HOME/klik-cmg-install-root"
+fi
 
-(sudo sh "$HOME/klik-cmg-install-root" && rm -f "$HOME/klik-cmg-install-root") || (dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root.") 
 fi
 
 #