Version Information Spy 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 build scripts, but you can get away with using the IDE if you don't change any resources.
Several DelphiDabbler libraries and components are required in to compile Version Information Spy. They are:
1 These components must be installed into the Delphi component palette since they are required at design time.
2 These components and classes must be available on Delphi's library path. They are not 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.
In addition the VIBinData.dll executable is required in order
for the Version Information Spy programs to run and for the
installer to be built. This library is available here. The source code for the DLL is available from this repository. The DLL source is not required to build
Version Information Spy.
You can edit and test compile parts of the project using the Delphi IDE. Delphi 2010 is the preferred compiler, and the rest of these instructions assume it is being used. The code may compile with later Delphis, but this is not guaranteed.
The following command line tools are required to compile the whole project using the build scripts.
DCC32
BRCC32
.rc) files. BRCC32 is supplied with Delphi 2010.
HHC
ISCC
ISPP. You can get Inno
Setup from the InnoSetup site.
VIEd
ZIP
ZIP is not required.
First you need to get the source code of Version Information Spy. There are two choices:
vis
by doing:
> svn checkoput http://verinfo-tools.googlecode.com/svn/trunk/vis/ vis
> svn checkout http://verinfo-tools.googlecode.com/svn/tags/vis/release-9.9.9/ vis
9.9.9 with the version number of the required
release. All available releases can be viewed in this branch of the SVN repository.
The build scripts require the following environment variables to be set:
DELPHI2010
DCC32
and BRCC32.
DELPHIDABLIBD2010
INNOSETUP
The following environment variables are optional:
HHCROOT
HHC.exe. If this environment variable is not set then
HHC.exe is expected to be found on the system path.
VIEDROOT
VIEd.exe. If this environment variable is not set the
VIED.exe must be on the system path.
ZIPROOT
Zip.exe. If this environment
variable is not set then Zip.exe must be on the path.
You may find it convenient to create a batch file that sets up the required environment for you. You can then run it before using the build scripts.
After checking out or downloading and extracting the source code you should have the following directory structure:
./
|
+-- DevTools - scripts used to build project
|
+-- Docs - documentation
|
+-- Src - root of soruce code tree, contains .bpg file
|
+-- App - main GUI application source
| |
| +-- Images - images included in main app resources
|
+-- CmdApp - command line app source
| |
| +-- Images - images included in command line app resources
|
+-- CtxMenu - context menu handler source
| |
| +-- Exports - interfaces exported by context menu handler
|
+-- Help - project HTML help file source
| |
| +-- CSS - help file's style sheet(s)
| |
| +-- HTML - help file's HTML topic files
| |
| +-- Images - images included in HTML topic files
|
+-- Imports - interfaces to third party DLLs
|
+-- Installer - source code of installer
|
+-- Reader - source of reader DLL
| |
| +-- Exports - interfaces exported by reader DLL
|
+-- Reporter - source of reporter DLL
| |
| +-- Exports - interfaces exported by reporter DLL
| |
| +-- Res - assets included in reporter DLL resources
|
+-- Shared - common code shared by different projects
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 have 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 DevTools
directory. Run any script you have created to set the environment variables
then do:
> Config
This script does two things:
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.
.cfg files for each Delphi sub-project from template
files. .cfg files are required to configure the Delphi command
line compiler. These new files will be ignored by Subversion.
You must now place a copy of VIBinData.dll into the
Exe directory. Version Information Spy requires this
DLL, which is not part of the project, in order to run. See above for
details of where to get the DLL.
If you are intending to edit and compile the code using the Delphi IDE you
must also run the following script from the DevTools directory:
> BuildResources
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.
There are two ways of building the code:
Src except Imports and Shared
contains a script named Build.bat that is used to build
that sub-project.
DevTools directory contains various scripts that can be
used to build the whole project and to create releases.
All these scripts are run from a console window with current directory set to
DevTools. The environment variables described above must be set
before using the scripts.
The available tools are:
BuildResources
.res files are placed in the
appropriate sub-directories of Bin. This script must be run
before using BuildPascal.
BuildPascal
Exe directory.
BuildResources must be run before running this script.
BuildHelp
Exe directory.
BuildInstaller
VIBinData.dll must have been copied to the
Exe directory before running this script. The resulting
program is placed in the Exe directory.
BuildAll
VIBinData.dll must have been copied to the Exe
directory before running this script.
Release
.zip file containing the install file and a
read-me file. The .zip file is placed in the
Release directory.
Tidy
Config
Sub projects can be built using the Build.bat scripts found in
the sub project's source directory. The scripts are controlled by passing
parameters to them. They are described below.
To use a script open a console window, set up the environment if necessary, then set the console's working directory to the appropriate source directory.
The available build scripts are:
.\Src\App\Build.bat
all - builds everything.
res - builds binary resource files.
pas - builds Pascal source and links with resource
files.
.\Src\CmdApp\Build.bat
all - builds everything.
res - builds binary resource files.
pas - builds Pascal source and links with resource
files.
.\Src\CtxMenu\Build.bat
all - builds everything.
res - builds binary resource files.
pas - builds Pascal source and links with resource
files.
.\Src\Help\Build.bat
.\Src\Installer\Build.bat
VIBinData.dll must have been copied to the
Exe directory.
.\Src\Reader\Build.bat
all - builds everything.
res - builds binary resource files.
pas - builds Pascal source and links with resource
files.
.\Src\Reporter\Build.bat
all - builds everything.
res - builds binary resource files.
pas - builds Pascal source and links with resource
files.
Note: Many of the DevTools scripts call these scripts.
Because FileVerCM.dll hooks into Windows Explorer it can be
difficult to test and may sometimes refuse to compile.
So that the development version of the DLL is used by Explorer on its context menu and in the file property sheet, you need to make sure that the correct file is used by Explorer.
The easiest way to do this is to first ensure there is a valid install of
Version Information Spy because this creates the required registry
entries. Next run RegEdit with administrator privileges and find all
sub-keys in HKEY_CLASSES_ROOT\CLSID that contain a path to
FileVerCM.dll and change them to reference the development
version of the file. You can change them back later by re-installing the
program or by manually changing the paths back to their old values.
You may also want to change the FileVer.exe sub-key of
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App
Paths to reference the development exe file and path. This will enable
FileVerCM.dll to find the development version of the GUI program
rather than starting the installed version. Again, a fresh install should
restore the original value.
Once FileVerCM.dll has been used by Explorer you may find that
the DLL remains loaded and can't be overwritten by a fresh compile. Close all
Explorer windows and check if the compile now succeeds. If this doesn't help
(and it often doesn't) you need to restart Explorer entirely. Do this as
follows:
explorer.exe and stop it
by right clicking and choosing the End Process from the context
menu. This action kills the desktop and task bar so don't close Task
Manager!
explorer.exe in the resulting Create New Task dialog
box. Click OK to restart Explorer. The desktop and taskbar should
come back.
FileVerCM.dll should now have been unloaded and a fresh compile
should succeed. If this fails try repeating the above procedure but do the
recompile between steps 2 and 3 while Explorer is not running.
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 Spy source code.