在Windows平台上创建Tcl Starkit的步骤 [英] Steps to Create A Tcl Starkit on a Windows Platform

查看:231
本文介绍了在Windows平台上创建Tcl Starkit的步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚在Windows中创建Tcl starkit的基本步骤.之前,我曾问过类似的问题,还购买了一本有关Tcl编程的书,访问过wiki.tcl.tk,直接通过电子邮件发送给Tcl程序员,等等.总而言之,我从我的资源中得到了很多反馈网站;但是,在构建批处理文件,使用命令控制台和创建目录方面,我未能完全说明我是一个新手.

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, visited wiki.tcl.tk, emailed Tcl programmers directly, etc... In all, I've received great feed back from my resources and this website; however, I've failed to explain that I am a complete novice when it comes to building batch files, using a command console, and creating directories.

我真的需要一个人为我自己说出一些基本的事情,因为我似乎无法解释任何人想告诉我的事情.我认为Visual Studio和.NET使我变得愚蠢:)

I really need someone to basically spell things out for me, because I cannot seem to interpret what anyone is trying to tell me. I think Visual Studio and .NET has made me stupid :)

当前,我已经下载了tclkit,tclkitsh和sdx.kit,并创建了一个简单程序(Test_App.tcl).到目前为止,我知道我必须通过创建一个批处理文件(sdx.bat),创建一个vfs目录然后使用sdx wrap在控制台(tclkitsh)上运行sdx.我完全忘了如何执行这些简单的步骤.

Currently, I have downloaded tclkit, tclkitsh, and sdx.kit, as well as created a simple program (Test_App.tcl). So far, I know I have to run sdx through the console (tclkitsh) by creating a batch file (sdx.bat), create a vfs directory, and then use sdx wrap. I am completely oblivious on how to do these simple steps.

这似乎有很多问题要问,但是如果有人可以用超级新手翻译创建一个starkit,我将非常感激.我希望是这样的:在tclkitsh控制台中,键入以下内容……;在tclkit.exe中,键入以下内容;现在你应该有...;等等.

This seems like too much to ask, but if someone could translate creating a starkit in uber novice terms I would be incredibly grateful. I was hoping something like: In tclkitsh console, type the following...; in tclkit.exe, type the following...; now you should have...; and on.

谢谢

DFM

推荐答案

步骤1:创建工作目录.打开Windows命令提示符.可能在开始菜单附件",命令提示符"下.键入命令"mkdir temp",然后使用"cd temp"将其cd到该目录:

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.

步骤2:下载必要的文件.您需要三件事,一个

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).

下载这三个文件,并将它们放在您创建的临时目录中.严格来说,这不是必需的,但是它使本教程更容易.重命名命令行tclkit,也使本教程更容易:

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

步骤3:验证一切正常.在不使用其他任何参数的情况下运行sdx.kit.它应该打印出一些帮助信息:

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>

第4步:为您的代码创建目录. sdx假定对于名为"myapp"的应用程序,存在一个名为"myapp.vfs"的目录:

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>

第5步:创建代码.创建一个名为"main.tcl"的文件,并将其放置在myapp.vfs目录中.使用记事本或您选择的文本编辑器.给文件提供以下内容:

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

验证myapp.vfs看起来像这样:

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

步骤6:使用sdx包装代码.将工作目录放在原始临时目录中,发出以下命令以包装代码.

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

第7步:将包装的文件重命名为.exe后缀. sdx.kit应该已经创建了一个名为"myapp"的文件.为了运行此程序,您需要将其重命名为"myapp.exe".完成后,可以通过键入命令"myapp"或双击资源管理器窗口中的图标来运行它.

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"

这篇关于在Windows平台上创建Tcl Starkit的步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆