HTMLRes is written in Object Pascal and is targeted at Delphi 7. 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.
These notes apply only to source code of releases after
HTMLRes v1.2.0. For any earlier version please see the file named
ReadMe-Src.txt that will be in either the root directory or the
Docs sub-directory.
The following libraries and components are required in to compile HTMLRes:
You should download these DelphiDabbler code libraries and install them all
together into a package or at least ensure that the compiled
.dcu files are all in the same folder. It's easiest to use the
Delphi IDE to do this.
Set the DELPHIDABLIB environment variable to the folder where
you placed the compiled library code.
You need the Delphi VCL in order to compile this code.
The following tools are required to build HTMLRes.
A copy of Delphi is required to build the object Pascal code. Delphi 7 is preferred. Delphi 2005 to 2008 should be able to compile the source. Delphi 2009 and later may work, but the code hasn't been written with Delphi 2009's Unicode support in mind, so there may be problems. Delphis earlier than version 7 are likely to fail to compile HTML, but this hasn't been tested.
You can use the Delphi IDE to edit the code and test compile it. The makefile requires the following command line tools:
DCC32
BRCC32
.rc) files.
The following environment variables are associated with these tools:
DELPHIROOT - required unless DELPH7 is set.
DCC32 and BRCC32 are expected to be in
the Bin sub-directory of DELPHIROOT.
DELPHI7 - optional
DELPHIROOT
will ignore its own value and use the value of DELPHI7
instead.
DELPHIDABLIB - required unless DELPHIDABLIB7
is set.
DELPHIDABLIB7 - optional
DELPHIDABLIB regardless
of its own value.
This is the make tool that ships with Delphi. You can use any version that works.
This tool is used to compile version information (.vi) files
into intermediate resource source (.rc) files. Version 2.11.2
or later is required. Version Information Editor can be obtained from
http://www.delphidabbler.com/software/vied.
The program is expected to be on the path unless its install directory is
specified by the VIEDROOT environment variable.
The Inno setup command line compiler is used to create HTMLRes' install program. The compiler is supplied with Inno Setup v5.2.3 or later. The ISPP pre-processor v5.2.3 or later is also required. You can get Inno Setup at http://www.innosetup.com/.
The program is expected to be on the path unless its install directory is
specified by the INNOSETUP environment variable.
This program is used to create HTMLRes' 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.
The first step is to configure the required environment variables.
DELPHIROOT or DELPHI7ROOT
DELPHIDABLIB or DELPHIDABLIB7
Set any of the optional environment variables that are needed to specify the path to any tools that are not on the system path.
You can configure environment variables either by modifying your system environment variables or by creating a batch file that you run before performing the build.
If you don't already have it, download the HTMLRes source code. How to go about that is explained at http://www.delphidabbler.com/software/htmlres/download. If necessary, extract the source code into a folder, preserving the directory structure.
After checking out or downloading and extracting the source code you should have the following directory structure:
./ | +-- Demo - demonstration source code & support files | +-- Docs - documentation | +-- Src - source code
If, by chance you also have a Bin, Exe and
Release directory don't worry - all will become clear.
Subversion users will also see the usual .svn hidden
directories. If you have done some editing you may also see occasional
hidden __history folders, depending on which version of Delphi
you are using.
Before you can get hacking, you need to prepare the code tree. Open a
command console and navigate into the Src sub-folder. Run any
script you have created to set the required environment variables then do:
> Make config
You may need to replace Make with the full path to
Make if it isn't on the path, or if the Make that
runs isn't the Borland / CodeGear version. If this is the case try:
> %DELPHIROOT%\Bin\Make config
or
> %DELPHI7%\Bin\Make config
depending on which environment variable you have set.
Once Make config has completed your folder structure should
have acquired the following new folders:
./ | +-- Bin - receives object files and .res files | ... | +-- Exe - receives executable code | +-- Release - receives release files | ...
If the Bin, Exe and Release folders
already existed they will have been emptied. In addition, Make
will have created .cfg and .dof files from
templates in the Src folder. .cfg files are needed
for DCC32 to run correctly and .dof files enable the use of the
Delphi IDE. These files will be ignored by Subversion.
If you are intending to use the Delphi IDE to compile code, you should also do:
> Make resources
This compiles the resource files that the IDE needs to link into compiled executables.
You are now ready to build the source.
You have several options:
Each of these options is described below. All except the last assume that
Make config has been run.
This is the most common build and is achieved by using the following commands:
> Make resources > Make pascal
HTMLRes.exe will be generated and placed in the
Exe folder.
The setup program requires that HTMLRes.exe is present in the
Exe directory.
Once you have built all the required files you build the setup file by doing:
> Make setup
The setup program is named HTMLRes-Setup-x.x.x.exe, where
x.x.x is the version number extracted from HTMLRes' version
information. It is placed in the Exe directory.
Once the setup file has been created you can create a zip file containing
the setup file along with ReadMe.txt from the Docs
directory. If either file is missing the release fails. Build the release by
doing:
> Make release
By default the release file is called dd-htmlres.zip. You can
change this name by defining the RELEASEFILENAME macro or
enviroment variable. For example, you can name the file
MyRelease.zip by doing:
> Make -DRELEASEFILENAME=MyRelease release
You can do a clean build of everything, and generate the release zip file simply by doing:
> Make
without specifying a target. This is the equivalent of:
> Make config > Make resources > Make pascal > Make setup > Make release
Various temporary files and directories are created by the IDE. These can be deleted by running:
> Make clean
Be warned though that this command removes any __history
folders that some versions of Delphi use to maintain earlier versions of
files.
If you are planning to re-use or modify any of the code, please see the file
SourceCodeLicenses.txt in the Docs directory for
an overview of the open source licenses that apply to the HTMLRes
source code.