How to build a release of Apache for Windows

Paul Sutton <pcs@apache.org>
This document describes how to release Apache for Windows (95 and NT). It is an appendix to the main how to build a release of Apache document.

Overview

The steps to build an Apache for Windows release are:

Detailed Instructions

Before starting this build, make sure that you have the correct Apache file tree available. This will normally by a normal Unix release archive. Make sure that all the non-binary files have DOS style line endings. You will need a copy of the comercial product InstallShield Express 2.0. You will need that product and not InstallFromTheWeb, InstallShield 5, the ancient InstallShield 2, or any of the variants of InstallShield occasionally bundled with the Java or C development environments.

Building the Windows installer requires to temporary directories.

  1. Create The Install Directory

    You will need to decide on a directory where you are going to place the install files. These are the files used by InstallShield to build the installer program. The examples in this document will use the directory C:\Apache which is also the default installation directory of the "nmake installr" command. If you use this directory you will not need to edit the apache.iwz InstallShield configuration file before using it.

    Now create the install directory, and extract the Apache Unix release archive into it. If the distribution has Unix line endings, convert the line endings of all files apart from htdocs/*.gif and icons/*.gif and icons/small/*.gif.

    The following files and directories are not used or installed on Windows systems:

    (Note: the InstallShield configuration file lists only the files which are to be build into the installer, so it is not necessary to remove these files and directories unless you are planning to update the IS configuration by dragging-and-dropping directories).

    Rename the file README.NT in the install directory to README-NT.TXT:

      CD C:\Apache
      RENAME README.NT README-NT.TXT
    

    Copy the MSVCRT.DLL file into the install directory. This file can be found on the MSVC++ 5.0 CD (it is a redistributable file), or in the \WINDOWS\SYSTEM (Win95) or \WINNT\SYSTEM32 (WinNT) directories.

      COPY \WINDOWS\SYSTEM\MSVCRT.DLL C:\Apache  (Windows 95)
      COPY \WINNT\SYSTEM32\MSVCRT.DLL C:\Apache  (Windows NT)
    

  2. Build and Install Apache

    Create the build directory by copying the src directory of the install directory to the new location. The examples in this document will use C:\Build.

    Now build Apache in the normal way and install it into your install directory:

      cd C:\Build
      nmake /f Makefile.nt _apacher
      nmake /f Makefile.nt installr INSTDIR=C:\Apache
    
    This will add the compiled APACHE.EXE, core DLL files and module DLL files into the install directory.

  3. Building the Installer DLL

    The installer DLL is called during the user install process to configure the Apache configuration files. Build it and copy it into the install directory:

      CD C:\Build
      nmake -f Makefile.nt installdll
      COPY os\win32\installer\installdll\Release\install.dll C:\Apache
    

  4. Update the InstallShield Configuration File

    Now the install directory contains all the files which are going to be used in the install process. The InstallShield configuration file specifies all the files to be used, and where they will be installed on the end user's machine. The configuration file is in os/win32/installer/apache.iwz.

    There are two things to do to update the InstallShield configuration file. Firstly, update the configuration to reflect any new, removed or renamed files in the Apache distribution. Secondly, update the version information if necessary.

    Note: Unfortunately InstallShield's configuration file format contains hard-coded absolute paths to the individual files. If your install directory (step 1) is not C:\Apache then must search and replace all instances of C:\Apache with your install directory in apache.iwz before using it. If you want to commit the changed version back to the repository, remember to search and replace from you install directory with C:\Apache before committing.

    Start InstallShield Express 2, then load the os/win32/installer/apache.iwz file from the build directory (e.g. C:\Build).

    After making the changes above you will have to commit the updated apache.iwz file back to the CVS tree. Do not forget to change references to your install directory back to C:\Apache if you used a different directory. Also remember to copy the updated apache.iwz file over the older version in the install directory so that the end user will have the correct version:

      CD C:\Build
      COPY os\win32\installer\apache.iwz C:\Apache\src\os\win32\installer
    

  5. Build the Installer

    The install directory tree and InstallShield configuration are now complete. The install directory tree will look like this:

      C:\Apache
      |  ABOUT_APACHE
      |  Annoucement
      |  Apache.exe
      |  ApacheCore.dll
      |  CHANGES
      |  CHANGES.APACI
      |  configure
      |  INSTALL
      |  install.dll
      |  KEYS
      |  LICENSE
      |  Makefile
      |  Makefile.tmpl
      |  MSVCRT.DLL
      |  README
      |  README.configure
      |  README-NT.TXT
      |  STATUS
      |
      |--- conf
      |      access.conf-dist-win
      |      highperformance.conf-dist
      |      httpd.conf-dist-win
      |      magic
      |      mime.types
      |      srm.conf-dist-win
      |
      |--- htdocs
      |    | index.html
      |    | apache_pb.gif
      |    |-- manual
      |        ....
      |
      |--- icons
      |      ....
      |
      |--- logs (empty)
      |
      |--- modules
      |      ApacheModuleAuthAnon.dll
      |      ...
      |
      |--- src
      |    | ...
      |    |--- ap
      |    .......
    
    

    After it has been installed on the user's machine it will look mostly the same, except that:

    At the end of the installation, the user will have the option of viewing a README. This will be the README-NT.TXT file (which is the file README.NT in CVS).

    So finally build the single-file installer. Run InstallShield Express 2. Load the configured apache.iwz file from your build directory.

    Build the package by selecting "Disk Builder", "Start Build". Then create the single file installer by selecting "Copy to Floppy", set "Drive" to "Path for a 1 File Installation" (and enter an appropriate directory name), then select "Copy All Disk Images".

    The single file installer is now built and ready to run. It will be called SETUPEX.EXE. Rename this to an appropriate name for Windows, such as APACHE_1_3_4.EXE (there must only be one period in the name).