Datasheet

2. Add this directory to the Windows search path. On older versions of Windows, use the
autoexec.bat file in the root directory of the boot drive. (More recent versions of Windows
still support this, but they also provide a graphical environment editor that you by opening the
System applet from the Control Panel.)
If the text field containing the path variable is too small to see the entire value, cut and paste the
value to your text editor, make the appropriate change, and then cut and paste the modified
value back to the path edit field.
3. The new search path applies only to shells that are opened after the change, so exit and restart
your shell.
Recommended Settings for Windows
For this book, the following environment variables are recommended on Windows systems:
UTIL_DIR=c:\program files\utility
LUA_DIR=c:\program files\lua\5.1
LUA_CPATH=?.dll;%LUA_DIR%\?.dll
LUA_PATH=?.lua;%LUA_DIR%\?.lua
The UTIL_DIR variable identifies the utility directory you created in the preceding section. Additionally,
if you have a software development kit and intend to compile Lua and possibly libraries for Lua, set the
following environment variables:
SDK_DIR=c:\program files\msc
INCLUDE=%SDK_DIR%\include;%SDK_DIR%\include\usr
LIB=%SDK_DIR%\lib;%SDK_DIR%\lib\usr
The SDK_DIR depends on where you installed your SDK.
Restart your shell for environment changes to take effect. Then use Windows Explorer or the command
shell to create the various directories that these environment variables identify.
Dealing with Tarballs and Zip Files
Whether you install Lua using precompiled packages or compile it from a source code package, you will
be dealing with a packaging form colloquially known as a tarball. Files of this type have the extension
.tar.gz or .tgz. A tarball bundles a group of files that can be distributed over one or more directories.
The contents, owners, permissions, and timestamps of the bundled files are preserved using the
tar util-
ity, whose name derives from its original purpose of transferring files to and from a tape archive. The
amalgamated file is then compressed using the
gzip utility or, for tarballs with the .tar.bz2 extension,
using the slower and more aggressive
bzip2 compression utility. Although tarballs are part of the Unix
tradition, tools for managing them on Windows are freely available. In particular, one versatile open-
source utility for Windows that handles any type of package you are likely to encounter is
7z. Both
graphical and shell-oriented versions are available from
www.7-zip.org. Whichever version you use,
make sure the directory in which you install 7-zip is included in your system search path. Extracting the
6
Chapter 1: Getting Situated
04_069172 ch01.qxp 1/2/07 7:53 PM Page 6