home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!walter!grumpy!bytor
- From: bytor@grumpy.bellcore.com (Ross Huitt)
- Subject: Installation/Distribution Problems
- Message-ID: <1992Jul21.150227.18823@walter.bellcore.com>
- Sender: bytor@grumpy (Ross Huitt)
- Nntp-Posting-Host: grumpy.ctt.bellcore.com
- Organization: Bellcore
- Date: Tue, 21 Jul 92 15:02:27 GMT
- Lines: 51
-
- I've not had problems with installations but I have had problems with distribution.
- It is really not practical for me to require that users of my prototypes install
- the full Tk/Tcl/... configuration just to run my software. So, I ship binaries.
- This leads to problems in that they likely don't have Tcl/Tk installed so the script
- libraries aren't present. So, I ship the binaries along. Of course, I can't have
- them worry about them putting the scripts in the same place I installed mine. My solution
- to this particular solution, although temporary, is a step in the right direction.
- I have essentially extended the init command in main.c for Tk to check for environment
- variables if the script directories don't exist. If the environment variables don't
- exist, it defaults to the current directory. (I'll probably add the ability to check for
- other common locations for the script libraries. ) It is not unreasonable to have
- users of my software specify some extra environment variables before running it, so this
- is proving to be a very viable solution.
-
- One request to John O.: _Please_ make the Tcl Library a variable (maybe $tcl_library)
- in the next release. Keep [info library] around for compatibility but have it just return
- $tcl_library. I _hate_ having to replace the info command just to reset the tcl library
- location.
-
- My new init_cmd[] for wish is attached below. Enjoy.
-
- char initCmd[] = "\
- set tcl_library [info library]; \
- if ![file isdirectory $tcl_library] { \
- if [info exists env(TCL_LIBRARY)] { set tcl_library $env(TCL_LIBRARY) \
- } else { \
- set tcl_library [pwd]; \
- }; \
- rename info old.info.proc; \
- proc info {args} { \
- global tcl_library; \
- if [llength $args]==1&&![string compare library [lindex $args 0]] { \
- return $tcl_library; \
- } else { \
- return [eval \"old.info.proc $args\"] \
- } \
- } \
- }; \
- if ![file isdirectory $tk_library] { \
- if [info exists env(TK_LIBRARY)] { set tk_library $env(TK_LIBRARY); \
- } else { \
- set tk_library [pwd] \
- } \
- }; \
- source $tk_library/wish.tcl \
- ";
-
-
- Ross Huitt
- bytor@ctt.bellcore.com
-
-