set env(TCL_LIBRARY)}
	    lappend scripts {
if {[regexp ^tcl(.*)$ [file tail $env(TCL_LIBRARY)] -> tail] == 0} continue
if {$tail eq [info tclversion]} continue
file join [file dirname $env(TCL_LIBRARY)] tcl[info tclversion]}
	}
	if {[info exists tclDefaultLibrary]} {
	    lappend scripts {set tclDefaultLibrary}
	} else {
	    lappend scripts {::tcl::pkgconfig get scriptdir,runtime}
	}
	lappend scripts {
set parentDir [file dirname [file dirname [info nameofexecutable]]]
set grandParentDir [file dirname $parentDir]
file join $parentDir lib tcl[info tclversion]} \
	{file join $grandParentDir lib tcl[info tclversion]} \
	{file join $parentDir library} \
	{file join $grandParentDir library} \
	{file join $grandParentDir tcl[info patchlevel] library} \
	{
file join [file dirname $grandParentDir] tcl[info patchlevel] library}
	if {[info exists tcl_libPath]
		&& [catch {llength $tcl_libPath} len] == 0} {
	    for {set i 0} {$i < $len} {incr i} {
		lappend scripts [list lindex \$tcl_libPath $i]
	    }
	}
    }
    set dirs {}
    set errors {}
    foreach script $scripts {
	lappend dirs [eval $script]
	set tcl_library [lindex $dirs end]
	set tclfile [file join $tcl_library init.tcl]
	if {[file exists $tclfile]} {
	    if {[catch {uplevel #0 [list source $tclfile]} msg opts]} {
		append errors "$tclfile: $msg
"
		append errors "[dict get $opts -errorinfo]
"
		continue
	    }
	    unset -nocomplain tclDefaultLibrary
	    return
	}
    }
    unset -nocomplain tclDefaultLibrary
    set msg "Can't find a usable init.tcl in the following directories: 
"
    append msg "    $dirs

"
    append msg "$errors

"
    append msg "This probably means that Tcl wasn't installed properly.
"
    error $msg
  }
}
tclInit