RS: Self-contained scripts [we need a wiki page for what this phrase means and techniques to accomplish it] also need no installation, if they do exec magic for Unix, and a regular Tcl installation (with .tcl association, etc.) is present on Windows. In place of delivering separate icon files, they may be put in the script as base64 encoded data, and loaded as such.
Stu: Jan 4, 2004 Here's a mini installer for single-file tcl scripts using exec magic. An interesting side-effect is that an installed program can still be used to install again. I've improved it a bit and it is now known as SIFT.
#! /bin/sh ######################################################################################### # \ if [ "$1" == "--help" ] ; then # \ echo "Run without options to run normally, or install with:" # \ echo " --install src dest user group mode path-to-tclsh" # \ echo "Do it like that, the installer is dumb." # \ echo -n "Example: ./myapp.tcl --install ./myapp.tcl" # \ echo " /usr/local/bin/myapp root bin 555 /usr/local/bin/tclsh8.4" # \ exit # \ elif [ "$1" == "--install" ] ; then # \ echo "Installing ($2) to ($3), user($4) group($5) mode($6) path-to-tclsh($7)" # \ sed -e "19,39s!/usr/local/bin/tclsh8.4!$7!" < "$2" > "$3" && \ # \ chown "$4":"$5" "$3" && \ # \ chmod "$6" "$3" # \ exit # \ else # \ if [ -x /usr/local/bin/tclsh8.4 ] # \ then exec /usr/local/bin/tclsh8.4 "$0" ${1+"$@"} # \ else exec tclsh "$0" ${1+"$@"} # \ fi # \ fi # \ #########################################################################################
Category Deployment | Category Glossary