TortoiseHg and Mercurial installer builder for Windows
The most up to date version of this information can be found on this repository's wiki: http://bitbucket.org/tortoisehg/thg-winbuild/wiki/Home
contrib/ - Bundled libraries and utilities external to (T)HG misc/ - Miscellaneous files used to build packages gtk-dist/ - directory where you copy GTK+ redistribution files
hg-main - Mercurial repository hg-stable - Mercurial stable repository tortoisehg - TortoiseHg repository hgfold - case folding conflict detection and resolution extension hgcr-gui - code review extension
=== Prerequisites ===
GTK+ for Windows
Get latest package requirements from: http://bitbucket.org/tortoisehg/stable/wiki/developers/installer
Read gtk-distREADME.txt for instruction on how to copy the redistribution files into gtk-dist.
If you are only building Mercurial packages, you only need to find msgfmt.exe somewhere and place it in your path.
Python 2.5 (0.6 and 0.7 were built with 2.5.1)
C:PythonNN and C:PythonNNScripts must be in your path.
iniparse (TortoiseHg only, not used by Mercurial)
Download iniparse-0.3.1.tar.gz and install. http://code.google.com/p/iniparse/ See instructions below for using easy_install to install iniparse
See instructions below for using easy_install to install pygments
MinGW gcc installed and in your path
The MinGW compiler must be installed, as the build script uses it to build Mercurial.
Inno Setup 5 installed
Install ispack-5.3.4.exe, which includes Inno Setup Preprocessor, which is required for building packages with this script.
=== Mercurial Man Pages ===
rst2html (from docutils) is used to build HTML man pages.
rst2html.py will be installed in your PythonNNScripts folder when you install docutils.
=== TortoiseHg Doc Prerequisites ===
To build documentation, you need sphinx and it's ken. These commands should do the trick.
> hg clone http://bitbucket.org/birkenfeld/sphinx/ > cd sphinx > python setup.py install
This will install any missing sphinx prereqs setuptools, docutils 0.5, jinja2, and pygments. Once this is done, you can use easy_install to install iniparse. The always-unzip argument is important, because py2exe cannot read into egg files.
> easy_install --always-unzip iniparse
To build PDFs you need miktex installed: http://miktex.org/2.7/setup After install, you must place %ProgramFiles%MikTex NNNmiktexbin in your path.
The build scripts assume sphinx, miktex, and HTML Help compiler are all installed. You will have to modify the iss file of TortoiseHg if you do not want to build the documentation. The details of this are left as an excercise to the reader.
== HTML Help Workshop ==
Used to generate CHM documentation, it can be downloaded from:
== Compiling shell extensions ==
The recommended method for building the shell extensions is to download and install "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1" from microsoft.com. See the win32/shellext/README.txt file in the TortoiseHg source for details on installing this package.
== DLL dependencies ==
Your python DLL will have C runtime library dependencies. To be safe you should open your pythonXX.dll in the "dependency walker" tool to be absolutely sure you know which DLL it needs, then copy that DLL into the contrib folder in the root of thg-winbuild.
Also be aware of dependencies reported by py2exe. At least once you should run 'python setup.py py2exe -b2' manually inside build-thg and look at the library depdendencies. You'll want to copy into contrib/ any DLL whose name begins with "msvcr".
== Build Steps ==
It's mostly automated. For help, use
python setup.py --help
If you are doing automated builds, it is recommend you use the -fF flags to force the scripts to re-clone the build targets each time. If you are building by hand, you should use the -fF flags or --clean anytime you switch between stable and unstable targets, or just to get a clean start.
Note that setup.py assumes that .py files are registered with Windows so that they can execute directly. That is, entering
(without "python") in the Windows command prompt should start the setup script (see the section "Registering .py files with Windows" for how to fix this if it doesn't).
== Default Paths ==
Subrepo clones do not setup default paths in .hg/hgrc files like normal clones do. As a result, you will not be be able to pull or push from the subrepos yourself until you create .hg/hgrc files in each subrepo.
As a convenience, the setup.py script has a --pull command that pulls the TortoiseHg repository and hg-stable. Any command that builds a nightly or unstable package will also pull the source repositories.
== Registering .py files with Windows ==
In Explorer go to Tools->Folder Options...->File Types. Scroll to the registered file type of PY and then click on the Change... button to choose the program to associate (e.g. "C:Python25python.exe"). Including ".py" in the PATHEXT environment variable might be needed in addition, so that the command prompt will attempt to execute .py files, using the registry associations to find the executable.