From: Daniel A. S. <st...@ic...> - 2001-12-10 08:11:23
|
Andrew, sorry for the delay At 1:44 +0000 on 6/12/01, Andrew Wilson wrote: >How do I build a single-file download containing a standalone >version of my pure-tcl application? > >I'd assumed that the answer was: > >1. install the latest tcl/tk for macos 9 >2. drop the .tcl script onto the D&D Tclet app >3. put the resulting app into a folder, compress it and put > it on the web. > >But it looks like I need to ensure that users of the application >have also installed the latest tcl/tk on their own machines. This >is not so good... I need the application to work on a user's >machine even if they've got no copy of tcl/tk. > >If I attempt to run the application on a machine that has no tcl/tk >installed, then starting the application results in an error dialog. >I seems to be looking for a system/extensions/tcltkstuff (sic) >folder, can't find it and panics. > >Is there a way to construct the application so that it contains >all the necessary *.tcl library files, say in a series of resources, >or by adding the *.tcl files to the shipped application's folder. >It would be nice if I didn't have to install those shipped libraries >under the system/extensions folder on the target machine. several solutions are possible, but nothing quite as easy as freewrap et al on other platforms, in particular I don't know of anything except JCW's tclkit allowing real single file executables on MacOS. the simplest solution is as follows: firstly you should use the statically linked Wish ("Simple Tk (PPC)") as the Wish Stub for D&D Tclets. Note that for this to work you'll either need an appropriately populated "(Support Libraries)" subdirectory or you can merge the ppc MSL & MoreFiles shared libraries from that directory directly into Wish using e.g. MPW's MergeFragment or other such tools. this will obviate the need for shared Tcl & Tk libraries in the system folder. to enable Tcl/Tk to find its encodings and packages in your local directory, you need to add environment variables to Wish's STR# 128 resource ("Tcl Environment Variables"), you'll probably need both TCL_LIBRRARY and TK_LIBRARY, set them to e.g. ":tcl" and ":tk" and add corresponding subdirectories containing the minimal subset of "Tool Command Language:tcl8.3" and "Tool Command Language:tk8.3" needed to startup (you probably don't need all encoding files etc). to allow tcl to find additional private packages you may also need to add other local directories to the auto_path as usual. If you expect your users to use MacOS 9.0 or higher, you could then package your directory structure as a OSX-style package, this will give it the appearance of a single file executable in the Finder. (c.f. http://developer.apple.com/technotes/tn/tn1188.html) Hope this helps Cheers, Daniel -- ** Daniel A. Steffen ** "And now to something completely ** Department of Mathematics ** different" Monty Python ** Macquarie University ** <mailto:st...@ma...> ** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/> |