0

I was wondering how to make a TCL program into an executable. I starting messing around with TCL a few days ago, so I don't know too much about it. But I don't think I am using tk in any way. I'm not even entirely sure what tk is, so I figured I would just stick to TCL for now. But if I have a simple TCL program, how do I make it into an executable file with .exe extension?

user1569574
  • 21
  • 2
  • 6

2 Answers2

2

Create a starpack. That bundles your code with a Tcl interpreter.

glenn jackman
  • 238,783
  • 38
  • 220
  • 352
  • I looked here: http://wiki.tcl.tk/11861 on how to create a starpack but found myself being confused. Could you please relate to me step by step for Windows? – user1569574 Jun 28 '13 at 14:54
  • If I follow the freewrap option, I get an error in the cmd: 'freewrap' is not recognized as an internal or external command, operable program or batch file." – user1569574 Jun 28 '13 at 15:42
  • 1
    There's been at least [one question](http://stackoverflow.com/q/1379577/301832) on this in the past… – Donal Fellows Jun 29 '13 at 13:11
0

To share scripts with people that don't have Tcl installed and don't want to install it, I've found it much easier to distribute a stand-alone tclsh.exe or wish.exe file together with the script. FreeWrap has such files, just rename freewrap.exe or freewrapTCLSH.exe respectively. The latest version of FreeWrap, 6.6, has TCLLIB and TKLIB included in the interpreter executable.

Besides being easier for you, it has the advantage that the user can alter the script text file if he wishes, and that if he feels uncomfortable downloading your exe-files, he can delete the tclsh.exe/wish.exe and download his own copy.

I've noticed though, that the FreeWrap wish interpreter doesn't report uncatched foreground errors when they reach global level; the program exits silently. I catch the entire script and report errors myself with a dialog box, e.g. tk_messageBox -message $errorInfo -title $errorMsg -type ok. Background errors OTOH are automatically reported.

potrzebie
  • 1,768
  • 1
  • 12
  • 25