Steps to Create A Tcl Starkit on a Windows Platform

后端 未结 1 874
不思量自难忘°
不思量自难忘° 2020-12-03 15:41

I am trying to figure out the basic steps to creating a Tcl starkit in Windows. I\'ve asked a similar question before, as well as purchased a book on Tcl programming, visit

相关标签:
1条回答
  • 2020-12-03 16:28

    Step 1: make a working directory. Open up a windows command prompt. This is probably under the start menu, "Accessories", "Command Prompt".Type the command "mkdir temp", then cd to this directory with "cd temp":

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    
    C:\Documents and Settings\Owner>mkdir temp
    
    C:\Documents and Settings\Owner>cd temp
    
    C:\Documents and Settings\Owner\temp>
    

    Make a note of where this directory is. It should tell you right on the prompt.

    Step 2: Download the necessary files. You need three things, a base kit that inclues Tk (which will become part of the wrapped application), sdx.kit (a tclkit that has the commands that do the wrapping) and the command line version of tclkit (from which sdx.kit will be run).

    Download the three files and put them in the temporary directory that you created. Strictly speaking this isn't necessary, but it makes this tutorial easier. Rename the command line tclkit, also to make this tutorial easier:

    C:\Documents and Settings\Owner\temp>dir
     Volume in drive C has no label.
     Volume Serial Number is F434-9FD3
    
     Directory of C:\Documents and Settings\Owner\temp
    
    09/05/2009  04:32 PM    <DIR>          .
    09/05/2009  04:32 PM    <DIR>          ..
    09/05/2009  04:21 PM           105,528 sdx.kit
    09/05/2009  04:31 PM         1,268,686 tclkit-win32.upx.exe
    09/05/2009  04:27 PM           668,142 tclkitsh-win32.upx.exe
                   3 File(s)      2,042,356 bytes
                   2 Dir(s)  13,232,046,080 bytes free
    
    C:\Documents and Settings\Owner\temp>rename tclkitsh-win32.upx.exe tclkit.exe
    

    Step 3: verify that everything is working. Run sdx.kit with no other arguments. It should print out a little bit of help information:

    C:\Documents and Settings\Owner\temp>tclkit sdx.kit
    Specify one of the following commands:
     addtoc    eval      fetch     ftpd      httpd     httpdist  ls        lsk
     md5sum    mkinfo    mkpack    mkshow    mksplit   qwrap     ratarx    rexecd
     starsync  sync      tgz2kit   treetime  unwrap    update    version   wrap
    
    For more information, type:  sdx.kit help ?command?
    
    C:\Documents and Settings\Owner\temp>
    

    Step 4: create a directory for your code. sdx assumes that for an application named "myapp" that there exists a directory named "myapp.vfs":

    C:\Documents and Settings\Owner\temp>mkdir myapp.vfs
    
    C:\Documents and Settings\Owner\temp>dir
     Volume in drive C has no label.
     Volume Serial Number is F434-9FD3
    
     Directory of C:\Documents and Settings\Owner\temp
    
    09/05/2009  04:37 PM    <DIR>          .
    09/05/2009  04:37 PM    <DIR>          ..
    09/05/2009  04:37 PM    <DIR>          myapp.vfs
    09/05/2009  04:21 PM           105,528 sdx.kit
    09/05/2009  04:31 PM         1,268,686 tclkit-win32.upx.exe
    09/05/2009  04:27 PM           668,142 tclkit.exe
                   3 File(s)      2,042,356 bytes
                   3 Dir(s)  13,231,599,616 bytes free
    
    C:\Documents and Settings\Owner\temp>
    

    Step 5: create your code. Create a file named "main.tcl" and place it in the myapp.vfs directory. Use notepad or the text editor of your choice. Give the file the following contents:

    package require Tk
    label .l -text "Hello, world"
    pack .l
    

    Verify that myapp.vfs looks like this:

    C:\Documents and Settings\Owner\temp>dir myapp.vfs
     Volume in drive C has no label.
     Volume Serial Number is F434-9FD3
    
     Directory of C:\Documents and Settings\Owner\temp\myapp.vfs
    
    09/05/2009  04:40 PM    <DIR>          .
    09/05/2009  04:40 PM    <DIR>          ..
    09/05/2009  04:40 PM                60 main.tcl
                   1 File(s)             60 bytes
                   2 Dir(s)  13,231,456,256 bytes free
    

    Step 6: wrap the code using sdx. With your working directory in the original temporary directory, issue the following command to wrap your code.

    C:\Documents and Settings\Owner\temp>tclkit sdx.kit wrap myapp -runtime tclkit-w
    in32.upx.exe
    1 updates applied
    
    C:\Documents and Settings\Owner\temp>dir
     Volume in drive C has no label.
     Volume Serial Number is F434-9FD3
    
     Directory of C:\Documents and Settings\Owner\temp
    
    09/05/2009  04:43 PM    <DIR>          .
    09/05/2009  04:43 PM    <DIR>          ..
    09/05/2009  04:44 PM         1,272,604 myapp
    09/05/2009  04:40 PM    <DIR>          myapp.vfs
    09/05/2009  04:21 PM           105,528 sdx.kit
    09/05/2009  04:31 PM         1,268,686 tclkit-win32.upx.exe
    09/05/2009  04:27 PM           668,142 tclkit.exe
                   5 File(s)      3,315,000 bytes
                   3 Dir(s)  13,229,654,016 bytes free
    

    Step 7: rename the wrapped file to have a .exe suffix. sdx.kit should have created a file named "myapp". In order to run this you'll need to rename it to "myapp.exe". Once you do that you can run it by typing the command "myapp" or double-clicking on the icon from an explorer window.

    C:\Documents and Settings\Owner\temp>rename myapp myapp.exe
    
    C:\Documents and Settings\Owner\temp>myapp
    

    If all went well, a window should pop up with the label that says "Hello, world"

    0 讨论(0)
提交回复
热议问题