Deliver Tcl/Tk based single-file executables

So ... now you've been hacking with tcl and Tk for a bit, and you have this *nifty* little killer-app that you want to share with your friends ... *however* they dont have tcl/tk installed and don't want to install it ...

The solution is simple, just create a Starpack and send them a single-file executable... (or, just make it available on your website)

What *is* a Starpack?

A Starpack is a special kind of a Starkit, that wraps your script into a standalone single-file program, using Tclkit.

Creating a Starpack

The first steps required to create a Starpack, are to gather the necessary tools:

  1. An appropriate Tclkit for your Operating System. (recent Linux, Windows, and Mac kits also available here.)
  2. A copy of the SDX kit.
  3. The script that you want to wrap into an executable program. (A sample "Hello World" script is located here , along with a hello.kit, and starpacked executables for Linux and Windows.)
  4. A copy of the Tclkit referenced above, renamed to something like, copykit, for example.

Now, create a Starkit:

  1. Start tclkit
  2. Source sdx.kit
  3. qwrap your script - eg qwrap hello.tcl - You should now have a working starkit, which you can easily test by starting up tclkit and sourcing hello.kit

A typical linux command line for the above would look like:
steveo@linux:~/Desktop> ./tclkit sdx.kit qwrap hello.tcl

Next, unwrap the hello.kit file, to create the vfs (virtual file system) that will be needed for the last step:
steveo@linux:~/Desktop> ./tclkit sdx.kit unwrap hello.kit

Finally, create the single-file executable:
steveo@linux:~/Desktop> ./tclkit sdx.kit wrap hello -runtime copykit
This should result in the creation of an executable named hello.

And now, a Surprise...

Hold on, you say - my friends all run Windows ...

No Problem! Go back, and fetch a copy of tclkit for windows, rename it to something like - winkit - , and in the final step above - change hello to hello.exe, substitute winkit for copykit, and *like magic*, you have created a fully functional GUI program that will run on windows, without having to ever touch a windows computer, or write a single line of MFC code!

(By the way, if you are a windows maven, just reverse the tclkits, and provide your Linux user friends an executable program, without ever touching a linux box, or learning anything about using gcc!)

About Tclkit, Starkits and Starpacks

Everything you will ever need to know about Tclkit is available from the link on the left.

For much more on Starkits and Starpacks, see Steve Landers' excellent paper "Beyond Tclkit", available here.

A wide variety of fun and useful Starkits are freely available here.


Home