Setting up Tk804 for use by the gui* utilities.


Guiguts, (and guiprep to a lesser extent) have been modified to take advantage of special features of perl/tk that are available in tk804. Tk804 is still in beta and isn't released anywhere as a compiled package, so if you want to use the advanced features that it offers, your choices are somewhat limited.

  1. Install the precompiled "perl runtime libraries" on your computer. For Windows users, this is probably a better (or at least, substantially easier) choice but may have some negative implications if you are planning to do any development in perl. The perl runtime libraries are basically a complete install of all of the perl executables and libraries in a full install of perl, with all of the documentation and development files stripped out to reduce size.

  2. Compile it and install it yourself. Really the only option for Linux or MacOSX users. It is complex, but not horribly difficult, and there is a walk through (for Mac, at least) on setting it up as part of getting guiguts working, researched and written by pourlean. For Windows users, your OS doesn't come with a compiler by default, so you'll need to come up with a compiler too. There are some options there, but they require some fairly substantial downloads.


Hopefully, at some time in the near future, there will be perl packages available with perl\Tk804 included by default, and all of this will become moot. But for now, if you want the advanced features of tk804, you'll have to expend a little extra effort.



Installing the "Perl Runtime Libraries":

Download the latest perl runtime library file prl03.zip. (5724k) This file contains a complete perl runtime environment with tk804.026 installed already. It should work on any version of Windows from Win98 through WinXP. (tested on Win98SE, Win2K and WinXP)

The Zip file contains  directory "prl" with all of the libraries and dlls it needs inside of it. Unzip the file wherever you want the directory installed. It is preferable, though not absolutely necessary that you avoid directory names with spaces or more than 8 characters in the name. Assume, for example, you want to install it in a directory called C:\dp\tools. Extract the prl.zip file into the C:\dp\tools directory. You will end up with a directory called C:\dp\tools\prl. This directory needs to be put into the path.

Under Win98, Win98SE and WinME; Open the file C:\Autoexec.bat with a text editor and look for the line that starts with PATH= (Typically will be something like PATH=C:\Windows;C:\Windows\system;C:\Windows\command;  etc.) Add to the end (or beginning), the path name of the prl directory with a terminating semicolon - C:\dp\tools\prl;

Under Win2k or WinXP; Go to Start->Settings->Control Panel. Open the System tool. Go to the Advanced tab. Select Environmental Variables. In the top box, the user variables, select the PATH variable and select Edit. Add the path to the prl directory with a terminating semi colon to the end (or beginning.) Click Ok, Ok, Ok.

If you already have perl installed on your computer, you will need to put the prl directory earlier in the path than the Perl\bin directory or the perl interpreter will be called instead of the perl runtime libraries. If you want to have both on your computer you may need to rename the perl directory temporarily while you are using the runtime libraries and rename back when you are done. Alternatively, you can leave the perl runtime libraries out of your path and call them directly in the startup link.

If you don't have administrative rights to your computer, (IE, can't modify your path) there are still a few options. Easiest perhaps, is to just move the contents of the prl directory into the guiguts directory. This is essentially what the executable download used to be. I split it up differently so I could maintain the libraries separately from the script.

Another option is to associate the .pl extension with the perl.exe perl interpreter executable in the prl directory. You will then be able to run the guiguts.pl script just by double clicking on it in an explorer window. A side benefit of this is it will let you run other perl scripts also by just double clicking on them.



Compiling it yourself:

These instructions are primarily geared toward windows users. Some of the resources will be the same for other OSs, some will not.


Prerequisites:

Perl:

Perl/Tk804 requires at least perl 5.8.0 for it to work correctly. If you don't already have it, download and install perl 5.8.x. (Whichever is available. 5.8.3 as of this writing.) You may elect to compile the entire perl package, but it isn't really necessary. Building on tk804 top of the ActiveState perl interpreter will probably be least problematic.

The ActiveState perl interpreter is probably the most popular for Windows users. (95, 98, 98se, ME, NT, 2K, XP) It's very functional and free. (They do ask that you register, but you can bypass the registration page without entering anything if you like.) For Windows users, if you use the Microsoft Installer (MSI) version, it is very simple and automatic to set up. If you don't have Microsoft Installer, a link is included on the Activeperl download page.

If you want to compile the entire perl package, the source may be found at www.cpan.org.


Perl/Tk804:

The source code for perl/Tk804 can be found at http://search.cpan.org/~ni-s/Tk-804.026 (Download link) These instructions are written for use with perl/Tk804.025_beta014. They should be substantially similar with later perltk releases. The files com as a gzipped tar archive. You will need to uncompress and un tar the files (Most Zip programs understand both gz and tar files.)



Compiler:

If you are using ActiveState perl as a base, the Tk package will need to be compiled with Microsoft Visual C++ version 6.0 or higher to be compatible. MSVC++ is not a free product. Luckily, Microsoft has available a limited functionality compiler based on MSVC++ 7.1 for free off of their web site. It is a fairly substantial, multipart download, and requires Windows 2000 or higher to run. (It will not work on Win98 or WinME.) You will need to be running Internet Explorer to access some of the content. They use some ActiveX controls that aren't supported on other browsers.

Follow these steps to download and install the compiler. (Most of this is almost verbatim from a newsgroup post by Chris Whiting)

1) Install Microsoft .NET Framework Version 1.1 Redistributable Package from:

http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4842-8157-034D1E7CF3A3&displaylang=en


2) Install MS Framework SDK 1.1 (this includes the compiler and other libs and includes) from:

http://www.microsoft.com/downloads/details.aspx?FamilyId=9B3A2CA6-3647-4070-9F41-A333C6B9181D&displaylang=en


3) Install platform CORE SDK (this has windows.h etc.)

http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

4) Install MDAC SDK 2.7  (Microsoft data access components which includes modules such as odbc32.lib for odbc and others for OLE support) from:

http://www.microsoft.com/msdownload/platformsdk/sdkupdate/



5) These installs do not update your environment variables nor do they seem to contain executables that do this so, you need to  manually update your environment variables. Note that I installed all of the MS SDKs (if I had a choice) on my drive F.  You will need to adjust as necessary.


6a) Add to Path environment variable :

F:\Program Files\Microsoft SDK\Bin\;
F:\Program Files\Microsoft.NET\SDK\v1.1\Bin\;
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\;
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\;
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\;
F:\Program Files\Microsoft SDK\Bin\Win64\;

6b)Add to INCLUDE environment variable:

F:\Program Files\Microsoft SDK\include\;
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\;"F:\Program Files\Microsoft.NET\SDK\v1.1\include\

6c) Add to LIB environment variable:

F:\Program Files\Microsoft SDK\Lib\;
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib\;"F:\Program Files\Microsoft.NET\SDK\v1.1\Lib\


7) Reboot machine. (Alternatively, you can build a batch file that sets the various environment variables and only run it when you will be using the development tools, which is how I elected to do it.)

Compile the package:

1) From command prompt: Change to the install package directory where makefile.pl is located.  Run the following:

perl MakeFile.PL 

nmake     

nmake test

nmake install


2)  From the command prompt, you can regenerate activestate documentation with:

perl -MActivePerl::DocTools -e "UpdateHTML(1)"


Patch the package:

There are a few patches that need to be made for everything to work correctly.  I have submitted bug reports on these, so hopefully, they will not be necessary in the near future.


In file: \Per\lib\Tk\DragDrop\Win32Site.pm

Comment out line 26. Change it from:
 warn "Enable $w";
to
 #warn "Enable $w";


You now should have a working perl Tk804 interpreter.