Team LiB   Previous Section   Next Section

9.4 Installing the PDBA Toolkit for Win32

Before we discuss toolkit installation on Win32 systems, we need to make sure that the PDBA_HOME environment variable is in an accessible place. On Win32, only one mechanism ensures the availability of this variable — the Windows Registry. Although we'll use the Registry just once, we must make sure that PDBA_HOME can be accessed by programs running through the Windows Scheduler, through the Windows services system, or just as plain old scripts.

We recommend that the PDBA Toolkit and all its configuration files be stored on the C: drive, because of the way that Windows security works. Programs executing from drives other than C: may lack access to drives other than C: when running via the Windows Scheduler. Likewise, Perl scripts running as Win32 services may fail to work properly when executed from a network drive.

You will need to follow the steps in this section to install the toolkit on your Win32 platform so the scripts introduced in later chapters will work properly.

9.4.1 PDBA Registry Settings

Follow these steps to provide the proper registry settings:

  1. Visit our O'Reilly site and download PDBA.ppd. Save this to a suitable place such as C:\TEMP. (You only need this temporarily and can delete it afterwards):

    http://www.oreilly.com/catalog/oracleperl/pdbatoolkit
  2. Now install PDBA via ActivePerl's PPM program:[7]

    [7] You could also download PDBA_1_00_Win32.tar.gz, uncompress it, and install it manually, copying the files to the appropriate locations. PPM is much easier, though, and less error-prone.

    DOS> ppm
    PPM> install --location=c:\temp PDBA
    Install package 'PDBA?' (y/N): y
    ...
    Installing C:\Perl\site\lib\PDBA\CM.pm
    ...
    Installing C:\Perl\site\lib\PDBA\util\pdba.reg
    ...
    Installing C:\Perl\bin\pwc.pl
    ...
    Writing C:\Perl\site\lib\auto\PDBA\.packlist
    PPM>

    (Notice the -- location PPM argument used to locate the PDBA.ppd file. (Note that there are two dashes in the option, not one.)

  3. Once you've installed PDBA via PPM, you'll need to track down the pdba.reg file. If your Perl installation is on drive C:, its file path will be:

    C:\Perl\site\lib\PDBA\util\pdba.reg

  4. Edit this file with a right-click, and check to make sure you're happy with the default for PDBA_HOME, which we've preset to:[8]

    [8] You may be curious about the use of the forward slash, /, rather than the standard Windows backslash, \. The backslash has a special meaning in Perl, changing the meaning of following characters. Perl therefore requires two backslashes, , to really mean a single one, \. Because the Windows kernel uses a forward slash internally as the separator, using it in Perl works just fine.

    C:/pdba
  5. Change it if you wish and then exit from the file. To update the Registry, double-click the pdba.reg file via Windows Explorer.

  6. This installs the key [HKEY_LOCAL_MACHINE/Software/PDBA] with a PDBA_HOME entry assigned to C:/pdba (or whatever you've changed it to). Registry work is now over. Sighs of relief, as we go back to our lives, citizens.

  7. Finally, you need to copy the supplied configuration files from their installed location to the directory indicated by PDBA_HOME. You can do this by simply using the Windows Explorer to cut-and-paste the files from their current location. Alternately, you can use the copy command from the command prompt window. Assuming that the PDBA Toolkit was installed on drive C:, the configuration files will be located in the C:\Perl\site\lib\PDBA\conf directory, as in Figure 9-2. Assuming that PDBA_HOME is set to C:\pdba, the following command will locate the configuration files at their final destination:

    DOS> copy C:\Perl\site\lib\PDBA\conf\*.conf C:\pdba
Figure 9-2. PDBA configuration files
figs/pdba_0902.gif

9.4.2 Installing Additional Perl Modules

A few additional modules are required for the toolkit to work properly:

TimeDate

Graham Barr's TimeDate date parser.

Crypt::RC4

Kurt Kincaid's Crypt::RC4 cryptographic module.

Mail::Sendmail

Milivoj Ivkovic's OS-independent email sender.

Win32::Daemon

Dave Roth's invaluable module that allows us to create Win32 services in Perl.

Install the first three from ActiveState via PPM:

DOS> ppm 
PPM> install TimeDate
PPM> install Crypt-RC4
PPM> install Mail-Sendmail

The last module,Win32::Daemon, was described earlier in Section 9.2.5. This module allows Perl to act as a service on Win32, the same way it can run as a daemon on Unix. The URL for Win32::Daemon is:

ftp://ftp.roth.net/pub/ntperl/Daemon/20000319/Bin/

The latest version, as this book went to press, was daemon_5006.Zip. Download this file to a suitable location, such as C:\temp, and extract the Win32-Daemon.ppd file from the archive into C:\temp via your favorite unzip program. You're now ready to install the module via PPM:

DOS> ppm 
PPM> install --location=c:\temp Win32-Daemon
PPM> quit

As we describe later, this PPD file (shown in Example 9-11) loads up various other software components from Dave Roth's site, depending on how Perl interprets your OS architecture.

Example 9-11. Win32-Daemon.ppd
<SOFTPKG NAME="Win32-Daemon" VERSION="0,2000,06,20">
    <TITLE>Win32::Daemon</TITLE>
    <ABSTRACT>The Win32::Daemon extension for Win32 X86. Allows Perl 
              to be a Win32 service.</ABSTRACT>
    <AUTHOR>Roth Consulting (http://www.roth.net/)</AUTHOR>
    <IMPLEMENTATION>
            <OS NAME="MSWin32" />
            <ARCHITECTURE NAME="MSWin32-x86-object" />
        <CODEBASE 
    </IMPLEMENTATION>
    <IMPLEMENTATION>
            <OS NAME="MSWin32" />
            <ARCHITECTURE NAME="MSWin32-x86" />
        <CODEBASE
HREF="http://www.roth.net/perl/packages/x86/Win32/Daemon_5005.tar.gz" />
    </IMPLEMENTATION>
    <IMPLEMENTATION>
            <OS NAME="MSWin32" />
            <ARCHITECTURE NAME="MSWin32-x86-multi-thread" />
        <CODEBASE
HREF="http://www.roth.net/perl/packages/x86/Win32/Daemon_5006.tar.gz" />
    </IMPLEMENTATION>
    </SOFTPKG>

You're done with the installation! All of the Perl modules and scripts needed for the toolkit are now installed. Onward and upward to the toolkit configuration.

    Team LiB   Previous Section   Next Section