Version Information Editor Build Instructions

Introduction

Version Information Editor is written in Object Pascal and is targeted at Delphi 2010. The Delphi IDE can be used to modify the source and to perform test builds. Final builds should be built using the provided makefile, but you can get away with using the IDE if you don't change any resources.

Dependencies

Several DelphiDabbler libraries and components are required in to compile Version Information Editor. They are:

These components must be installed into the Delphi component palette since they are required at design time.

All the components and classes must be installed in the same directory, so the easiest thing to do is to install everything into the Delphi user design time package. See here if you need help doing this.

Build Tools

The following tools are required to build VIEd.

Delphi

A copy of the Delphi 2010 command line compiler is required to build the object Pascal code from the provided makefile.

You can use the Delphi IDE to edit the code and test compile it, but final builds should be created using the makefile, which requires the following tools that are supplied with Delphi:

The following command line tools are required to compile the whole project using the build scripts.

DCC32
The Delphi command line compiler.
BRCC32
The Borland resource compiler. This is used to compile resource source (.rc) files.

The following environment variables are associated with these tools:

DELPHIROOT - required unless DELPHI2010 is set.
Should be set to the install directory of the version of Delphi being used. DCC32 and BRCC32 are expected to be in the Bin sub-directory of DELPHIROOT.
DELPHI2010 - optional
This environment variable can be set to the Delphi 2010 install directory. When DELPHI2010 is defined DELPHIROOT will be set to the value of DELPHI2010.

Borland Make

This is the make tool that ships with Delphi. You can use any version that works.

DelphiDabbler Version Information Editor

Yes, you need an executable version of the tool you are going to build. Use an existing stable version from v2.11.2. This tool is used to compile version the program's version information (.vi) files into intermediate resource source (.rc) files. You can get the latest stable version from http://www.delphidabbler.com/software/vied.

Inno Setup

The Unicode version on the Inno setup command line compiler is needed to create CodeSnip's install program. v5.4.0 (u) or later is required as is a compatible version of the ISPP pre-processor. You can get Inno Setup with ISPP at http://www.jrsoftware.org/isinfo.php. Choose the Unicode version. If you already have the ANSI version the Unicode version can be installed alongside it - just use a different install directory and program group name.

The compiler is expected to be on the path unless its install directory is specified by the INNOSETUP environment variable.

Microsoft HTML Help Compiler (HHC)

This command line compiler is supplied with Microsoft HTML Help Workshop. It is used to compile the VIEd help file.

The program is expected to be on the path unless its install directory is specified by the HHCROOT environment variable.

Zip

This program is used to create VIEd's release file. You can get a Windows command line version at http://stahlforce.com/dev/index.php?tool=zipunzip.

The program is expected to be on the path unless its install directory is specified by the ZIPROOT environment variable.

Preparation

Get the Source Code

First you need to get the source code of Version Information Editor. There are two choices:

  1. Download the source code of the latest release from the Version Information Editor Download Page. Unzip the download into a suitable folder, preserving the directory structure.
  2. Get the source code of a suitable release or the latest development code using Subversion. Check out the latest development code into a folder named vied by doing:
    > svn checkoput http://verinfo-tools.googlecode.com/svn/trunk/vied/ vied
    Alternatively check out the source code of a release by doing
    > svn checkout http://verinfo-tools.googlecode.com/svn/tags/vied/release-9.9.9/ vied
    Replace 9.9.9 with the version number of the required release. All available releases can be viewed in this branch of the SVN repository.

Configure the Environment

The makefile requires that the following environment variables are set:

DELPHIROOT or DELPHI2010
DELPHIROOT must be set to the install directory of the version of Delphi being used. If you are using Delphi 2010 you can set DELPHI2010 to its install directory. If set DELPHI2010 will be used in preference to DELPHIROOT.
DELPHIDABLIB or DELPHIDABLIBD2010
DELPHIDABLIB must be set to the directory where the required DelphiDabbler components and library files are installed in the version of Delphi to be used. If you are using Delphi 2010 you can set DELPHIDABLIBD2010 instead and it will be used is preference.
INNOSETUP
Set to the install directory of Inno Setup 5. If not set Inno Setup must be on the system path.
VIEDROOT
Set to the path where the DelphiDabbler Version Information Editor (VIEd) is installed. If not set VIEd must be on the system path.
HHCROOT
Set to the path where the Microsoft HTML Help Compiler is installed. If not set the compiler must be on the system path.
ZIPROOT
Set to the path where Zip.exe is installed. If not set Zip.exe must be on the system path.
RELEASEFILENAME
Set to the name of the zip file to be used to store a release. This file name should have no path or extension. If not set then "dd-vied" is used.

You may find it convenient to create a batch file that sets up the environment that you run from a command window before running the makefile.

Configure the Source Tree

After checking out or downloading and extracting the source code you should have the following directory structure:

./
  |
  +-- Docs                   - documentation
  |
  +-- Source                 - main source code
      |
      +-- Assets             - assets to be included in resources
      |
      +-- Help               - source for help file: contains project files
          |
          +-- CSS            - style sheet used for help file
          |
          +-- HTML           - HTML help topic files

If your source tree also contains one or more of the Bin, Exe or Release directories that's OK, as will become clear later. Subversion users will also see the usual hidden .svn directories.

The first thing to do before attempting to hack the code is to configure the source tree. Open a console window and navigate to the Source directory. Run any script you have created to set the environment variables then do:

> make config

This script does two things:

  1. It creates the Bin, Exe and Release directories, along with various sub-directories of Bin that are required to receive the binary code. If any of these directories already existed they will have been emptied.
  2. It creates the .cfg file from a template file. This file is required to configure the Delphi command line compiler. The .cfg file will be ignored by Subversion.

If you intending to edit and compile the code using the Delphi IDE you must also run the following command from the Source directory:

> make resources

This creates the resource files that the IDE needs to link into compiled executables.

You are now ready to modify the code if you wish and to build the source.

Building Version Information Editor

The code is built using the makefile, which must be run from a command line that is set to the Source directory. Run any script you have created once, before using the makefile for the first time.

The makefile offers several options. They are:

make config
As we have already seen this command configures the source tree. It should be run before using any other command. The command creates the required Delphi .cfg file from its template and creates empty Bin, Exe and Release directories.
make resources
Compiles the resource files required to build the program. Files are placed in the Bin directory, which must exist.
make pascal
Compiles the pascal source using the required version of Delphi. Requires that resource files are present in the Bin directory. The compiled exe file is placed in the Exe directory.
make vied
Compiles VIEd from source. This command is equivalent to make resources followed by make pascal.
make help
Compiles the HTML help file from source. The compiled file is placed in the Exe directory.
make setup
Builds the setup program. The command requires that the VIEd executable and the help file have been compiled and are present in the Exe directory. It also requires that certain documents are present in the Docs directory. The compiled setup program is placed in the Exe directory.
make release
Creates a zip file containing the required release files. By default the release file is named dd-vied.zip but this can be changed by setting the RELEASEFILENAME environment variable (see above).
make everything or make
This is the default option used when make is run with no targets. It configures the source tree, builds the VIEd executable and the help file, then builds the install program and finally creates the release zip file.
make clean
Deletes unwanted and temporary files and directories from the source tree. The command does not delete the Bin, Exe and Release directories and contents and neither does it delete the .cfg from the Source directory.
make deepclean
Like make clean this command deletes unwanted and temporary files and directories. It also removes the directories and files created by make config, i.e. the Bin, Exe and Release directories along with the .cfg in the Source directory.

Note: If the make command fails to run you may need to use %DELPHIROOT%\Bin\Make or %DELPHI2010%\Bin\Make depending on which environment variable you have set.

Copyright

If you are planning to re-use or modify any of the code, please see SourceCodeLicenses.txt in the Docs directory for an overview of the various open source licenses that apply to the Version Information Editor source code.