To match these instructions, put tclkit.exe and sdx.kit in c:\Source
Now, in a command prompt:
> c:
> cd \source
# We need a copy of tclkit.exe to use for the final executable
> copy tclkit.exe runtime.exe
# Wrap the script into a .kit
> tclkit sdx.kit qwrap chess.tcl
# Unwrap the .kit into a vfs directory structure
> tclkit sdx.kit unwrap chess.kit
# Your chess.tcl now exists as chess.vfs/lib/app-chess/chess.tcl
# so delete the original (or move it if you prefer)
> del chess.tcl
# The .kit was a temporary step, so remove it too
> del chess.kit
# Move the PNGs inside the vfs
> mkdir chess.vfs\images
> move *.png chess.vfs\images
# You should now be able to wrap into an executable
# NOTE: the value for '-runtime' must refer to a COPY of tclkit.exe
# It cannot be the same executable that you are running
> tclkit sdx.kit wrap chess -runtime runtime.exe
You should now have a chess.exe, but it won't know where to find the PNG files.
Edit chess.vfs\lib\app-chess\chess.tcl along these lines:
Before :
set img [image create photo -file king.png]
After :
set kingFile [file join $starkit::topdir images king.png]
set img [image create photo -file $kingFile]
NOTE : You do not have to wrap every time you make a change. You can run the contents of the VFS in unwrapped form:
> tclkit.exe chess.vfs\main.tcl
Then, when you are happy with your app, perform the final wrap step again to make an executable:
> tclkit sdx.kit wrap chess -runtime runtime.exe
NOTE : The above is all written from memory and by a Mac user, so you may have to make some slight changes to suit your system.
If your code never does a 'cd', you can get away with just specifying relative paths starting with chess.vfs :
% set pathToFile [file join chess.vfs images whatever.png]
But, it's safer and hardly any extra typing to use starkit::topdir, from which you can build paths:
% set pathToFile [file join $::starkit::topdir images whatever.png]
There is also a variable, starkit::mode, that tells you whether you are running wrapped or unwrapped, but it is unlikely that you will need to make the distinction.
Chris