Tk Library Source Code

Artifact [8a53327b48]
Login

Artifact 8a53327b48aee721cdfad4fcf2a6fbffae82f2a5:

Attachment "installer.tcl.diff" to ticket [1559489fff] added by mic42 2006-09-19 06:01:53.
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