Index: /release-kits/shared/uninstaller/Uninstall.sh
===================================================================
--- /release-kits/shared/uninstaller/Uninstall.sh	(revision 17807)
+++ /release-kits/shared/uninstaller/Uninstall.sh	(revision 17808)
@@ -1,10 +1,16 @@
 if [ -f "setup.bash" ]; then
-#This is Greenstone 2
+	#This is Greenstone 2
 	. ./setup.bash > /dev/null
 	SEARCH4J_EXECUTABLE=$GSDLHOME/bin/$GSDLOS/search4j
-else
-#This is Greenstone 3
+
+elif [ -f "gs2build/setup.bash" ]; then
+	#This is Greenstone 3
 	. ./gs2build/setup.bash > /dev/null
 	SEARCH4J_EXECUTABLE=./bin/search4j
+
+else
+	echo "Couldn't find setup.bash. This copy of Greenstone appears to be corrupt."
+	echo "To manually uninstall, please delete the entire Greenstone home folder."
+	exit
 fi
 
@@ -17,12 +23,12 @@
 if [ -e "uninst.flag" ]; then
 
-	rm -rf packages/jre
-	rmdir packages
+	rm -rf packages/jre &> /dev/null
+	rmdir packages &> /dev/null
 	
-	rm -rf bin
+	rm -rf bin &> /dev/null
 		
-	rm uninst.jar
-	rm uninst.flag
-	rm Uninstall.*
+	rm uninst.jar &> /dev/null
+	rm uninst.flag &> /dev/null
+	rm Uninstall.* &> /dev/null
 	
 	CONTENTS=`ls`
@@ -30,5 +36,5 @@
 		GSDEL=`pwd`
 		cd ..
-		rmdir $GSDEL
+		rmdir $GSDEL &> /dev/null
 	fi
 fi
Index: /release-kits/shared/uninstaller/gsdl-template/setup.bash
===================================================================
--- /release-kits/shared/uninstaller/gsdl-template/setup.bash	(revision 17808)
+++ /release-kits/shared/uninstaller/gsdl-template/setup.bash	(revision 17808)
@@ -0,0 +1,240 @@
+# if this file is executed, /bin/sh is used, as we don't start with #!
+# this should work under ash, bash, zsh, ksh, sh style shells.
+gsdllang=en
+# encoding inputs and outputs
+gsdltoenc=""
+gsdlfromenc=""
+
+# see if the shell has any language environment variables set
+# see locale(7) manpage for this ordering.
+if test ! -z "$LC_ALL" ; then
+  gsdllang="$LC_ALL"
+elif test ! -z "$LANG"; then
+  gsdllang="$LANG"
+fi
+
+
+# note... all our output strings have the charset hard-coded, but
+# people may be using a different encoding in their terminal. LANG
+# strings look like "en_NZ.UTF-8".
+
+# Determine the requested output encoding
+case $gsdllang in
+  *.*)
+    gsdltoenc=`echo $gsdllang | sed 's/.*\.//'`
+    ;;
+esac
+
+# Our french and spanish strings are currently in iso-8859-1 encoding.
+case $gsdllang in
+  fr*|FR*)
+    gsdllang=fr
+    gsdlfromenc="iso-8859-1"
+  ;;
+  es*|ES*)
+    gsdllang=es
+    gsdlfromenc="iso-8859-1"
+  ;;
+  ru*|RU*)
+    gsdllang=ru
+    gsdlfromenc="koi8r"
+  ;;
+  *) # default
+    gsdllang=en
+    gsdlfromenc="iso-8859-1"
+  ;;
+esac  
+
+# "iconv" is the program for converting text between encodings.
+gsdliconv=`which iconv 2>/dev/null`
+if test $? -ne 0 || test ! -x "$gsdliconv" || test -z "$gsdlfromenc" || test -z "$gsdltoenc"; then
+# we can't convert encodings from some reason
+  gsdliconv="cat"
+else
+# add the encodings
+  gsdliconv="$gsdliconv -f $gsdlfromenc -t $gsdltoenc"
+fi
+
+# make sure we are sourced, and not run
+
+if test "$0" != "`echo $0 | sed s/setup\.bash//`" ; then
+# if $0 contains "setup.bash" we've been run... $0 is shellname if sourced.
+# One exception is zsh has an option to set it temporarily to the script name
+  if test -z "$ZSH_NAME" ; then
+  # we aren't using zsh
+  gsdl_not_sourced=true
+  fi
+fi
+
+if test -n "$gsdl_not_sourced" ; then
+  case "$gsdllang" in
+ "es")
+eval $gsdliconv <<EOF
+      Error: Asegï¿œrese de compilar este guiï¿œn, no de ejecutarlo. P. ej.:
+         $ source setup.bash
+      o
+         $ . ./setup.bash
+      no
+         $ ./setup.bash
+EOF
+  ;;
+  "fr")
+eval $gsdliconv <<EOF
+      Erreur: Assurez-vous de "sourcer" le script, plutï¿œt que de l'exï¿œcuter. Ex:
+         $ source setup.bash
+      ou
+         $ . ./setup.bash
+      pas
+         $ ./setup.bash
+EOF
+  ;;
+  "ru")
+eval $gsdliconv <<EOF
+      ï¿œï¿œï¿œï¿œï¿œï¿œ: ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œ. ï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œ.
+      ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ:
+         $ source setup.bash
+      ï¿œï¿œï¿œ
+         $ . ./setup.bash
+      ï¿œï¿œï¿œ
+         $ ./setup.bash
+EOF
+  ;;
+  *)
+eval $gsdliconv <<EOF
+	Error: Make sure you source this script, not execute it. Eg:
+		$ source setup.bash
+	or
+		$ . ./setup.bash
+	not
+		$ ./setup.bash
+EOF
+  ;;
+  esac
+elif test -n "$GSDLHOME" ; then
+  case "$gsdllang" in
+  "es")
+    echo 'ï¿œSu ambiente ya estï¿œ listo para Greenstone!' | eval $gsdliconv
+  ;;
+  "fr")
+    echo 'Votre environnement est dï¿œjï¿œ prï¿œparï¿œ pour Greenstone!' | eval $gsdliconv
+ ;;
+  "ru")
+    echo 'ï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œ Greenstone!' | eval $gsdliconv
+  ;;
+  *)
+    echo 'Your environment is already set up for Greenstone!'
+  ;;
+  esac
+elif test ! -f setup.bash ; then
+  case "$gsdllang" in
+    "es")
+eval $gsdliconv <<EOF
+Usted debe compilar el guiï¿œn desde el interior del directorio de inicio
+de Greenstone.
+EOF
+  ;;
+  "fr")
+echo 'Vous devez trouver la source du script dans le rï¿œpertoire de base de Greenstone' | eval $gsdliconv
+  ;;
+  "ru")
+eval $gsdliconv <<EOF
+ï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ Greenstone
+EOF
+  ;;
+  *)
+    echo 'You must source the script from within the Greenstone home directory'
+  ;;
+  esac
+else
+  GSDLHOME=`pwd`
+  export GSDLHOME
+  GSDLOS=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+  # check for running bash under cygwin
+  if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
+  then
+    GSDLOS=windows
+  fi
+  export GSDLOS
+
+  PATH=$PATH:$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS
+  export PATH
+
+  
+  
+  # Override Imagemagick and Ghostscript paths to the bundled applications shipped with greenstone if they exists otherwise use default environment variables.
+
+if test -d $GSDLHOME/bin/$GSDLOS/imagemagick ; then
+	PATH="$GSDLHOME/bin/$GSDLOS/imagemagick/bin:$PATH"
+	export PATH
+  
+	MAGICK_HOME="$GSDLHOME/bin/$GSDLOS/imagemagick"
+	export MAGICK_HOME
+  
+		if test "$GSDLOS" = "linux" ; then
+			LD_LIBRARY_PATH="$GSDLHOME/bin/$GSDLOS/imagemagick/lib:$LD_LIBRARY_PATH"
+			export LD_LIBRARY_PATH
+		
+		elif test "$GSDLOS" = "darwin" ; then
+			DYLD_LIBRARY_PATH="$GSDLHOME/bin/$GSDLOS/imagemagick/lib:$DYLD_LIBRARY_PATH"
+			export DYLD_LIBRARY_PATH
+		fi
+fi
+
+
+  # Note: Ghostscript is only bundled with Greenstone on Mac and Windows, not on Linux. The code below should be used only for the Darwin platform
+  # for Windows please see setup.bat
+if test -d $GSDLHOME/bin/$GSDLOS/ghostscript ; then
+	PATH="$GSDLHOME/bin/$GSDLOS/ghostscript/bin":"$PATH"
+	export PATH
+  
+	GS_LIB="$GSDLHOME/bin/$GSDLOS/ghostscript/share/ghostscript/8.63/lib"
+	export GS_LIB
+
+	GS_FONTPATH="$GSDLHOME/bin/$GSDLOS/ghostscript/share/ghostscript/8.63/Resource/Font"
+	export GS_FONTPATH
+fi
+  
+  
+  
+  MANPATH=$MANPATH:$GSDLHOME/packages/mg/man
+  export MANPATH
+  case "$gsdllang" in
+    "es")
+      echo 'Su ambiente ha sido configurado para correr los programas Greenstone.' | eval $gsdliconv
+    ;;
+    "fr")
+      echo 'Votre environnement a ï¿œtï¿œ configuï¿œre avec succï¿œs pour exï¿œcuter Greenstone' | eval $gsdliconv
+    ;;
+    "ru")
+eval $gsdliconv <<EOF
+ï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ, ï¿œï¿œï¿œï¿œï¿œ ï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œï¿œ Greenstone
+EOF
+    ;;
+    *)
+      echo 'Your environment has successfully been set up to run Greenstone'
+    ;;
+  esac
+fi
+unset gsdl_not_sourced
+unset gsdliconv
+unset gsdlfromenc
+unset gsdltoenc
+
+if test -e ext ; then
+  for gsdl_ext in ext/* ; do
+    cd $gsdl_ext > /dev/null
+    if test -e setup.bash ; then 
+      . ./setup.bash 
+    fi 
+    cd ../..  
+  done
+fi
+
+if test -e local ; then
+  PATH=$GSDLHOME/local/bin:$PATH
+  export PATH
+  LD_LIBRARY_PATH=$GSDLHOME/local/lib:$LD_LIBRARY_PATH
+  export LD_LIBRARY_PATH
+fi
+
+
