Index: installer.tcl
===================================================================
RCS file: /cvsroot/tcllib/tcllib/installer.tcl,v
retrieving revision 1.23
diff -u -r1.23 installer.tcl
--- installer.tcl	1 Jul 2006 03:37:56 -0000	1.23
+++ installer.tcl	18 Sep 2006 22:58:59 -0000
@@ -126,7 +126,7 @@
 
 		    # If the directory is empty after the recursion remove it again.
 		    if {![llength [glob -nocomplain [file join $sub *]]]} {
-			file delete $sub
+			run file delete $sub
 		    }
 		}
 	    } else {
@@ -177,8 +177,16 @@
 	log [join $args]
 	return
     }
-    eval $args
-
+    
+    if {[catch {
+        eval $args
+    } msg] == 1} {
+        if {$config(gui)} {
+            installErrorMsgBox $msg
+        } else {
+            return -code error "Install error:\n $msg" 
+        }
+    }
     log* .
     return
 }
@@ -543,6 +551,16 @@
     exit 1
 }
 
+proc installErrorMsgBox {msg} {
+    global config
+    tk_messageBox \
+	    -icon error -type ok \
+	    -default ok \
+	    -title "Install error" \
+	    -parent . -message $msg
+    exit 1
+}
+
 proc wait {} {
    global config
 
