Wednesday, October 20, 2010

A Starkit of Stars

I just sent out the first user-ready version of NewStars!

The main concern I had with using Tcl was that when it came time to distribute, every player would need to install Tcl.

However, there is a handy technology called "Star kit" (or in this case, "Star Package").

There are three components:
  1. Tclkit
  2. Starkit
  3. Star package
Tclkit is the program that does all the work. It is a single file Tcl/Tk interpreter.

A "Star kit" is a single file archive (like a jar) which contains all the Tcl files and DLL's needed, in whatever directory structure you like.

The Star package is a star kit, with tclkit wrapped in with self-extraction and execution.

I had used Freewrap before (which is another single file Tcl interpreter), but couldn't make it work.

Tclkit is very easy.

Starting from the base stars.tcl (in a scratch area):

sdx wrap stars.tcl
This creates a skeleton kit, with just the main script.

sdx unwrap stars.kit
Expand the kit virtual directory structure into a real directory structure - which we are going to populate and experiment with.

tclkit stars.vfs/main.tcl
Try and run from the real directory structure (for testing)

sdx wrap stars.kit
All done, make the kit (can test the kit with tclkit stars.kit).

sdx wrap stars -runtime tclkit
Bundle Tclkit into the Stars star kit, making a star package - which is executable on its own.

Mail out the executable!

No comments: