
WINDOWS BUILD INSTRUCTIONS
==========================


Build requirements
------------------

The following third-party tools/SDKs are needed to build PGP 6.0.2i:

  Microsoft Visual C++ 5.0 (http://www.microsoft.com)
  Microsoft Visual Studio 97 Service Pack 3 (http://www.microsoft.com/
   msdownload/vs97sp/full.asp)
  Microsoft Platform SDK January 1998
  Microsoft Windows NT DDK January 1997
  Microsoft Windows 95 DDK January 1998
  Microsoft Macro Assembler (MASM) 6.13
  Microsoft Common Control 4.72 (http://msdn.microsoft.com/developer/
   downloads/files/40comupd.htm)
  Microsoft MFC42.dll 4.21.7303 (Available in Windows NT 4 Service Pack 3 at
   C:\WinNT\System32\MFC42.dll)
  Microsoft Msvcrt.dll 5.00.7303 (Available in Windows NT 4 Service Pack 3 at
   C:\WinNT\System32\Msvcrt.dll)
  Vireo VTOOLSD 2.05b (http://www.vireo.com/vtd95.htm)
  Vireo Driver::Works 1.20 (http://www.vireo.com/vdw.htm)
  InstallShield 3.0 (http://www.installshield.com)


Preparing the build environment
-------------------------------

(1) Install Microsoft Visual C++ 5.0. Perform a "Custom" install and install
    all components except the online books.
 
(2) PGPdisk is compiled using the linker in VC++ 5.0, not the linker in VC++
    Service Pack 3. Duplicate the file "DevStudio/VC/bin/Link.exe". Rename
    the duplicated file "LinkOld.exe".
 
(3) Install Microsoft Visual Studio 97 Service Pack 3 to update VC++ 5.0.

(4) Duplicate the file "DevStudio/VC/bin/Link.exe". Rename the duplicated
    file "LinkNew.exe".

(5) Install Microsoft Platform SDK. Use the custom install option and install
    all components.

(6) Install the Microsoft Windows NT DDK and Microsoft Windows 95 DDK. Note
    that by default both of these will want to install into a directory named
    "DDK". Change the default name for one or both of these so they are
    installed into different directories.

(7) Install the remaining build tools:

     Microsoft Macro Assembler
     Vireo VTOOLSD
     Vireo Driver::Works
     InstallShield

(8) Open Microsoft Visual C++ and add the directory "DevStudio/VC/crt/src/
    intel/dll_lib/" to the list of include directories for library files. This
    is done through the "Options..." command in the Tools menu. Choose the
    "Directories" tab and add the needed directory. Make sure you are adding
    it to the library files list.


Preparing the source code tree
------------------------------

Before compilation, several additional steps are needed to prepare the source
tree:

(1) Reconstructing the source should yield a "clients" directory, a "libs"
    directory, and zip files "binaries1.zip" and "binaries2.zip". Use your
    favorite zip utility to decompress "binaries1.zip" and "binaries2.zip"
    into the "clients" and "libs" directories.

(2) Create the following empty folders:

     libs/pfl/win32/SecureMemory/winNT/sys/i386/free
     libs/pfl/win32/SecureMemory/winNT/sys/i386/checked

(3) Copy the following files to the directory "clients/pgp/win32/
    OutlookExpress/":

     MSSDK/include/wab.h
     MSSDK/include/wabapi.h
     MSSDK/include/wabcode.h
     MSSDK/include/wabdefs.h
     MSSDK/include/wablab.h
     MSSDK/include/wabmem.h
     MSSDK/include/wabnot.h
     MSSDK/include/wabtags.h
     MSSDK/include/wabutil.h

(4) Open "clients/pgp/win32/OutlookExpress/wab.h" and change all
    occurrences of '<' and '>' to "'". Save the file.

(5) PGP 6.0.2i includes two drivers (Windows 95/98 and Windows NT) which lock
    memory to prevent paging of sensitive data to disk. These drivers need to
    be built once during source code preparation. To build the Windows 95/98
    driver, first modify the "AS" and "DDKKPATH" variables in the file "libs/
    pfl/win32/SecureMemory/win95/PGPmemlock.mak" to reference the file "MASM/
    bin/ml" and Windows 95 DDK root directory, respectively. Next, make the
    "Win32 Release" configuration of the workspace file "libs/pfl/win32/
    SecureMemory/win95/PGPmemlock.dsw". This will generate 7 link warnings
    which can be ignored.

(6) To build the Windows NT memory locking driver, choose "Start->Programs->
    Windows NT DDK (Common)->Free Build Environment" from the Start menu. This
    will open a "configured" shell window. Navigate to the directory "libs/
    pfl/win32/SecureMemory/winNT/" and execute the command "build -cef".
    Ignore all "last line incomplete" warnings.

(7) Copy the Microsoft Common Control update executable (40comupd.exe) file,
    MFC42.dll shared library file, and Msvcrt.dll shared library file to the
    directory "clients/pgp/win32/Installer/Extras/".

(8) Make the "Win32 Release" configuration of the workspace file "libs/pfl/
    win32/InstallDll/install.dsw".

At this point, the source code hierarchy should be replicated for multiple
builds.


Setting source code flags
-------------------------

The following library flags are located in "libs/pgpcdk/priv/include/
pgpSDKBuildFlags.h":

 PGP_RSA: Set to 1 for RSA-enabled builds
 PGP_RSA_KEYGEN: Set to 1 to allow RSA key generation
 PGP_USECAPIFORRSA: Set to 1 to use Microsoft's Crypto API (CAPI) for RSA
  operations.
 PGP_USECAPIFORMD2: Set to 1 to use Microsoft's Crypto API (CAPI) for MD2
  hashing operations.
 PGP_USEBSAFEFORRSA: Set to 1 to use RSA's BSAFE library for RSA operations.
  Note that BSAFE is not included in these source code books.
 PGP_USEPGPFORRSA: Set to 1 to use the PGP implementation for RSA operations.
 PGP_USERSAREF: Set to 1 to use the RSAREF library for RSA operations. Note
  that RSAREF is not included in these source code books.

These flags should be set as follows for the three supported builds:

 Desktop Security (Admin and Client): PGP_RSA = 1, PGP_RSA_KEYGEN = 1,
  PGP_USECAPIFORRSA = 0, PGP_USECAPIFORMD2 = 0, PGP_USEBSAFEFORRSA = 0,
  PGP_USEPGPFORRSA = 1, PGP_USERSAREF = 0
 Personal Privacy: PGP_RSA = 1, PGP_RSA_KEYGEN = 1, PGP_USECAPIFORRSA = 0,
  PGP_USECAPIFORMD2 = 0, PGP_USEBSAFEFORRSA = 0, PGP_USEPGPFORRSA = 1,
  PGP_USERSAREF = 0
 Freeware: PGP_RSA = 1, PGP_RSA_KEYGEN = 0, PGP_USECAPIFORRSA = 0,
  PGP_USECAPIFORMD2 = 0, PGP_USEBSAFEFORRSA = 0, PGP_USEPGPFORRSA = 1,
  PGP_USERSAREF = 0

The following client flags are located in clients/pgp/shared/pgpBuildFlags.h:

 BETA: Set to 0 for release builds
 PGP_DEMO: Set to 0 for regular builds
 PGP_FREEWARE: Set to 1 when building PGPfreeware
 PGP_BUSINESS_SECURITY: Set to 1 when building PGP Desktop Security
 PGP_PGP_PERSONAL_PRIVACY: Set to 1 when building PGP for Personal Privacy
 PGP_ADMIN_BUILD: Set to 1 when building the admin. version of PGP Desktop
  Security
 NO_RSA_KEYGEN: Set to 1 to disable RSA key generation
 NO_RSA_OPERATIONS: Set to 1 to disable encrypting/signing with RSA keys
 CREDIT_RSA_BSAFE: Set to 1 when building an RSA-enabled version which uses
  RSAs BSAFE library

These flags should be set as follows for the three supported builds:

 Desktop Security (Admin): BETA = 0, PGP_DEMO = 0, PGP_FREEWARE = 0,
  PGP_BUSINESS_SECURITY = 1, PGP_PGP_PERSONAL_PRIVACY = 0, PGP_ADMIN_BUILD =
  1, NO_RSA_KEYGEN = 0, NO_RSA_OPERATIONS = 0, CREDIT_RSA_BSAFE = 0
 Desktop Security (Client): BETA = 0, PGP_DEMO = 0, PGP_FREEWARE = 0,
  PGP_BUSINESS_SECURITY = 1, PGP_PGP_PERSONAL_PRIVACY = 0, PGP_ADMIN_BUILD =
  0, NO_RSA_KEYGEN = 0, NO_RSA_OPERATIONS = 0, CREDIT_RSA_BSAFE = 0
 Personal Privacy: BETA = O, PGP_DEMO = 0, PGP_FREEWARE = O,
  PGP_BUSINESS_SECURITY = 0, PGP_PGP_PERSONAL_PRIVACY = 1, PGP_ADMIN_BUILD =
  0, NO_RSA_KEYGEN = 0, NO_RSA_OPERATIONS = 0, CREDIT_RSA_BSAFE = 0
 Freeware: BETA = 0, PGP_DEMO = 0, PGP_FREEWARE = 1, PGP_BUSINESS_SECURITY
  = 0, PGP_PGP_PERSONAL_PRIVACY = 0, PGP_ADMIN_BUILD = 0, NO_RSA_KEYGEN = 1,
  NO_RSA_OPERATIONS = 0, CREDIT-RSA-BSAFE = 0


Building the code
-----------------

(1) Modify the variables in the following batch files to point to your
    Developer Studio and PGPdisk source code folders:

     clients/disk/win32/PGPdiskDrvWin95/PGPdiskDrvDebug.bat
     clients/diskiwin32/PGPdiskDrvWin95/PGPdiskDrvRelease.bat
     clients/disk/win32/PGPdiskDrvNT/RunBuild.bat

(2) Open the workspace file "clients/pgp/win32/Pgp55.dsw" and make the "Win32
    Release" configuration of the "pgp55" project. The build process will
    generate twelve warnings which can be ignored. This workspace builds all
    PGP 6.0.2i binaries except PGPdisk into the directory "clients/pgp/win32/
    pgp55/Release/".
 
(3) Delete the file "DevStudio/vc/bin/Link-exe". Duplicate the file
    "DevStudio/VC/bin/LinkOld.exe". Rename the duplicated file "Link.exe".
 
(4) Close the workspace file "pgp55.dsw" project and open the workspace file
    "clients/disk/win32/PGPdisk.dsw". Choose "Batch Build..." from the Build
    menu. Check all "Release" and "free" configurations and click the Build
    button. This will build all PGPdisk binaries.

(5) Delete the file "DevStudio/vc/bin/Link.exe". Duplicate the file
    "DevStudio/VC/bin/LinkNew.exe". Rename the duplicated file "Link.exe".


Building the installer
----------------------

Building a full Desktop Security version actually requires building two
separate copies of the source tree, one for the client build and one for the
administrative build. Do the client build first and then the admin build. You
will need intermediate results from the client build to complete the admin
build, so do not delete the client build hierarchy until the admin build is
complete.

(1) Before building an installer, the uninstaller need to be built first. Open
    a command prompt window and navigate to the directory "clients/pgp/win32/
    Installer/".
 
(2) Execute the batch file "setupinstall.bat". This batch file copies all
    relevant files from the build directories into the install directiories.
    This batch file takes one of the following four parameters:

     DSADMIN - Desktop Security Admin build
     DSCLIENT - Desktop Security Client build
     PERSONAL - Personal Privacy build
     FREEWARE - Freeware build

(3) If this installer is for a Desktop Security Admin build, copy the
    directories "clients/pgp/win32/Installer/Disk1" through "clients/pgp/
    win32/Installer/DiskN" from the Desktop Security client build to the
    Desktop Security Admin directory "clients/pgp/win32/Installer/Data/Admin/
    ClientInstaller".
 
(4) Rules for the uninstaller are located in the InstallShield script file
    "clients/pgp/win32/Installer/Uninstaller/Uninstall/setup.rul". Set the
    value of the INCLUDEPGPDISK variable at the top of this file to "TRUE" or
    "FALSE", depending on whether or not PGPdisk is included in the current
    build.
 
(5) Navigate to the directory "clients/pgp/win32/Installer/Uninstaller/" and
    execute the batch file "Build.bat". This will build the uninstaller into
    the directory "clients/pgp/win32/Installer/Uninstaller/Diskl/".
 
(6) Run InstallShield's EXEBLDR application and choose the directory "clients/
    pgp/win32/Installer/Uninstaller/Diskl/" as the source directory. Check the
    "Compress the included files" and "Create a 32bit self-extracting EXE"
    options. Save the uninstaller executable in the directory "clients/pgp/
    win32/Installer/Data/PGP60/". By default, the name of the installer will
    be "Setupex.exe". Rename this file "Uninstall.exe".
 
(7) Rules for the installer are located in the InstallShield script file
    "clients/pgp/win32/Installer/setup/setup.rul". Several switches at the top
    of the file need to changed for the various builds. Here are the correct
    values for the various builds:

     Desktop Security (Admin): RSA = 1, TITLE = "PGP Desktop Security Version
      6.0.2i", TITLE2 = "PGP Desktop Security Version 6.0.2", ISADMIN =
      "TRUE", PGP_FREEWARE, = "FALSE", IS_QUALCOMM_BUILD = "FALSE",
      INCLUDEPGPDISKEX = "TRUE", PRODUCT_VERSION = "PGP Desktop Security,
      version 6.0.2i", INCLUDEINSTALLGUIDE = "TRUE", ISRSAADDON = "FALSE",
      INCLUDEPGPFONE = "FALSE"
     Desktop Security (Admin): RSA = 1, TITLE = "PGP Desktop Security Version
      6.0.2i", TITLE2 = "PGP Desktop Security Version 6.0.2i", ISADMIN =
      "FALSE", PGP_FREEWARE = "FALSE", IS_QUALCOMM_BUILD = "FALSE",
      INCLUDEPGPDISKEX = "TRUE", PRODUCT_VERSION = "PGP Desktop Security,
      version 6.0.2i", INCLUDEINSTALLGUIDE = "TRUE", ISRSAADDON = "FALSE",
      INCLUDEPGPFONE = "FALSE"
     Personal Privacy: RSA = 1, TITLE = "PGP Personal Privacy Version
      6.0.2i", TITLE2 = "PGP Personal Privacy Version 6.0.2i", ISADMIN =
      "NULL", PGP_FREEWARE = "FALSE", IS_QUALCOMM_BUILD = "FALSE",
      INCLUDEPGPDISKEX = "TRUE", PRODUCT_VERSION = "PGP Personal Privacy,
      version 6.0.2i", INCLUDEINSTALLGUIDE = "TRUE", ISRSAADDON = "FALSE",
      INCLUDEPGPFONE = "FALSE"
     Freeware: RSA = 0, TITLE = "PGP Freeware Version 6.0.2i", TITLE2 =
      "PGP Freeware Version 6.0.2i", ISADMIN = "NULL", PGP_FREEWARE = "TRUE",
      IS_QUALCOMM_BUILD = "FALSE", INCLUDEPGPDISKEX = "FALSE", PRODUCT_VERSION
      = "PGP Freeware, version 6.0.2i", INCLUDEINSTALLGUIDE = "TRUE",
      ISRSAADDON = "FALSE", INCLUDEPGPFONE = "FALSE"

(8) Navigate to the directory "clients/pgp/win32/Installer/" and execute the
    batch file "Build.bat". This will build the installer into the directories
    "clients/pgp/win32/Installer/Diskl/" through "clients/pgp/win32/Installer/
    DiskN/". The exact number of directories produced will depend on the
    particular build.
 
(9) Copy the directories "clients/pgp/win32/Installer/Disk1/" through
    "clients/pgp/win32/Installer/DiskN/" to a new directory "clients/pgp/
    win32/Installer/SingleInstall/".
 
(10)Run InstallShield's EXEBLDR application and choose the directory
    "clients/pgp/win32/Installer/SingleInstall/" as the source directory.
    Check the "Compress the included files" and "Create a 32bit self-
    extracting EXE" options. Save the installer executable to the desired
    location.


End of build instructions.
