[Robert Abitbol] I have downloaded the great Tclkit.exe and I have often started tcl programs by copying them and pasting them into tclkit.exe (it's a great system I find!) Now, how do I make a Tcl program executable? Do I use Tclkit.exe? Thanks! (Excellent answer provided by Alex [FW]) ---- '''These methods vs a Starkit exe''' Very important! Please note that in order to run a starkit exe app. needs the user to install Starkit in his/her machine. With either of these methods, no need to install anything: anyone using any Windows starting with Windows 98 can run the program. Click on the exe file and it runs before I can finish my sentence! Excellent! ----- '''How to compile a Tcl script and an icons directory into an exe (in Windows)''' This is how to compile a tcl script + an icons directory (or any other directory) into an exe program. Let's assume for the sake of the example that we have a script called Birds.tcl located in c:\Birds. Please copy the commands but don't forget to make the necessary adaptations. These instructions work for '''Windows.''' ----- '''Using tclkit.exe:''' '''Step 1''' Copy tclkit.exe and sdx.kit into the directory where your Tcl source code file is. Ex: in c:\Birds TCLKit.exe can be downloaded from: http://www.equi4.com/tkdownload.html Sdx.kit can be downloaded from: http://www.equi4.com/pub/sk/ ---> You will now have in c:\Birds the following files: * Birds.tcl * tclkit.exe * sdx.kit ----- '''Step 2''' Make a copy of the tclkit.exe into the directory where your TCL source code file is. Ex: in c:\Birds. Rename it to tclkit2.exe. ---> You will now have in c:\Birds the following files: * Birds.tcl * tclkit.exe * tclkit2.exe * sdx.kit ----- '''Step 3''' At Start/Run, type the following command (make the necessary adaptations): c:\Birds\tclkit sdx.kit qwrap birds.tcl You will then get the Tcl console. It will give a message: .. updates Leave the console ----- '''Step 4''' At Start/Run again type the following command (make the necessary adaptations): c:\Birds\tclkit sdx.kit unwrap birds.kit You will then get the Tcl console. It will give a message: ... updates applied Leave the console ----- '''Step 5''' At this stage, you have to copy the icons directory into the app directory that has been created. The directory created is for example: c:\Birds\Birds.vfs\lib\app-Birds Copy Icons into c:\Birds\Birds.vfs\lib\app-Birds and you will get: c:\Birds\Birds.vfs\lib\app-Birds\Icons (Make the necessary adaptations) ----- '''Step 6''' At Start/Run again type the following command (make the necessary adaptations): c:\Birds\tclkit sdx.kit wrap birds.exe -runtime tclkit2.exe Again you will then get the Tcl console. It will give a message: ... updates applied Leave the console ---> That's all folks! '''Your exe is ready. Congratulations! Have un!:)''' [Robert Abitbol] Thanks Alex [FW] for your great help! ----- '''Using freewrap.exe''' '''Step 1''' Same as above, copy freewrap.exe into the directory where your Tcl source code file is. freewrap.exe can be downloaded from: http://sourceforge.net/projects/freewrap/ ---> You will now have in c:\Birds the following files: * Birds.tcl * freewrap.exe ----- '''Step 2''' At Start/Run, open the command prompt usually by typing '''"cmd"'''. Then type the following command (make the necessary adaptations): cd Birds freewrap birds.tcl If you want to have custom icons in your app, then run the following command instead: freewrap birds.tcl -i my_custom_icon.ico The default build of freewrap only supports the following icons: * 16x16 16 colors * 32x32 16 colors * 32x32 2 colors Therefore your icon file should have the above icons. ---> That's all folks! '''Your exe is ready. ----- '''For Apple and Unix users''' For Apple users: Do ... (instead of Start/Run) For Unix users: Do ... (instead of Start/Run) ----- '''Comments''' "[How can I compile Tcl type scripts into binary code]" answers the question for many people. If you're starting from an appreciation of [Tclkit], as apparently is the case, a [Starpack] might well be the most natural follow-up. [FW]: Yep, the [starpack] page has the basic instructions. [FW]: I helped him solve this off-wiki. I was gonna fix up his instructions as to how to make a starpack but I figured they would be out of place on this page, since they're the same as to make any Starkit. I won't be so brash as to delete them though. [Robert Abitbol] Well just for fun, try to find instructions as clear as the ones above on this wiki. By the way: no need to complete them: I have done it. Thanks! I appreciate your excellent explanations! [aa] - [How to create my first Starpack] seems somewhat more clear to me than the instructions above, and has the advantage of not being limited to Windows. [Robert Abitbol] It works for you! Great then! Well it doesn't work for me and I am sure it doesn't work for a lot of people. To the contrary, [FW]'s explanations works perfectly, A1! As the latins used to say: "de gustibus non disputandem" : we cannot discuss tastes; to each his own. I am sure explaining a different way to create an exe won't hurt anyone! :) [LV] Robert, what do you mean when you say ''it doesn't work for me''? Once specifics of a problem are reported, someone can hopefully make adjustments, clarifications, expansions appropriately. [Robert Abitbol] Pages dealing with the very same subject-matter are way too complex for me '''from the start''' and I'm sure they are for many people also. So, instead of spending hours deciphering such pages, I thought I'd write a simpler procedure based on Alex [FW]'s excellent instructions [FW]. This tclkit is a beauty! ----- '''Look into Starpal''' [ZipGuy] You might also like to look at the [Starpal - TCL Development and Starkit generation] which offers a few interesting features . :) ---- '''Adaptation of these procedures to Starpal''' [Robert Abitbol] Oh! And if you decide to adapt the instructions above for Apple or Unix Operating systems, please be my guest. I did not do it since I run Windows. You could write 2 lines of text. Something like: For Apple users: Do ... (instead of Start/Run) For Unix users: Do ... (instead of Start/Run) ---- '''Unix and Linux are not the same''' [LES] Perhaps it should be noted that [Unix] is not the same as [Linux]. It is very easy to find support to all things [Tcl] in [Linux], but not so easy in the [BSD] Unix family. ----- See also: http://www.equi4.com/papers/skpaper4_2.html ---- [slebetman]: Added instructions for using [freewrap] since I find it is easier for me to answer the question "[how to compile a TCL script into an EXE program]" using it. Besides, the subject of this page is generic which makes [freewrap] a viable option. ---- Related to this page: there is a tcl2c compiler [tclc]. ---- [Category Deployment] Quik question?: Where do you get * Birds.tcl from?