#!/bin/sh
# the next line restarts using wish \
exec wish "$0" "$@"


wm withdraw .
set w ".sl"
toplevel $w
wm title $w "Set Application Links"
label $w.tclshl -text "Path to tclsh"
label $w.wishl -text "Path to wish"
entry $w.tclshe -width 40 -textvariable tclshv
entry $w.wishe -width 40 -textvariable wishv
button $w.ok -text "OK" -command {destroy $w}
label $w.stuff -text "Enter the paths to tclsh and wish"
label $w.stuff2 -text "or leave blank if you do not wish"
label $w.stuff3 -text "to create symbolic links in the "
label $w.stuff4 -text "Zipper! Directory."


grid $w.tclshl -column 1 -row 1
grid $w.tclshe -column 2 -row 1
grid $w.wishl -column 1 -row 2
grid $w.wishe -column 2 -row 2
grid $w.stuff -column 2 -row 4
grid $w.stuff2 -column 2 -row 5
grid $w.stuff3 -column 2 -row 6
grid $w.stuff4 -column 2 -row 7
grid $w.ok -column 2 -row 3

tkwait window $w
if [string compare $tclshv ""] {
	if [file exists tclsh] { file delete tclsh }
	exec ln -s $tclshv tclsh
}
if [string compare $wishv ""] {
	if [file exists wish] { file delete wish }
	exec ln -s $wishv wish
}
exit
