From bills@lcdmultimedia.com Fri Apr 24 20:20:20 CDT 1998 Article: 83938 of comp.lang.tcl From: "Bill Schongar" Subject: [A] Creating binary distributions on Windows Newsgroups: comp.lang.tcl Message-ID: <01bd6f87$c9dfd700$0400000a@crossbow.lcdmultimedia.com> X-Newsreader: Microsoft Internet News 4.70.1161 NNTP-Posting-Host: 207.228.220.130 Date: 24 Apr 98 14:04:24 GMT Lines: 54 Path: uuneo.neosoft.com!ultraneo.neosoft.com!newsgate.duke.edu!news.vt.edu!solaris.cc.vt.edu!nntprelay.mathworks.com!cam-news-hub1.bbnplanet.com!boston-news-feed1.bbnplanet.com!news.bbnplanet.com!news.destek.net!207.228.220.130 Xref: uuneo.neosoft.com comp.lang.tcl:83938 Howdy, (A related thread on this topic was up here in March, but I can't seem to find it anywhere except dejanews, so I'm just creating a new one. ) Nope, this isn't a question. Having run into the "how do I do this" question myself, but only recently finding an solution, I thought I'd share a method to make a working single binary "wish" for Windows distribution. (It's also solved my "how do I protect parts of my code" problem on both Windows and UNIX..) First, get the Plus-Patch (http://www.worldaccess.nl/~nijtmans/plus.html) and compile it. This gives you several things that you need - the static TCL/TK libraries (tcl80sa.lib, tk80sa.lib) and "tcl2c". Next, make a TCL script that just contains: set cmd "source main.tcl" eval $foo (There's a reason for this, I'll get to it in a minute" Now, run tcl2c on your TCL script. The following line assumes you need the TK libraries, and that the tcl script is called "foo.tcl": tcl2c -o foo.c foo.tcl -tk -a Now, compile that C file, adding the following libraries to the linker: oldnames.lib, msvcrt.lib, libc.lib, tcl80sa.lib, and tk80sa.lib (Note for the less-than-comfortable-with-VisualC++: All you have to do is start a new project workspace, add those library files to the linker list (in 'Project Settings'), and hit "Build All". If you don't want to point the linker to the TCL/TK static libs, just copy them into the directory with your other LIB files..) You now have a binary that, when run, will automatically source the file "main.tcl" (And you'd better have one, because it will error out fatally if it can't find it...) The reason not to use just "source main.tcl" in the TCl script you're compiling is that it will embed any files which are "source"d that way, which gives you a complete binary with all the code internalized, but you have to recompile the EXE for evey application. Okay, I'll stop typing now.. take this all with a grain of salt - I just got everything working right last night.. : ) -Bill