thg-winbuild /

Filename Size Date modified Message
194 B
139 B
5.7 KB
11.9 KB

TortoiseHg and Mercurial installer builder for Windows

The most up to date version of this information can be found on this repository's wiki:

Repository subdirs:

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 ===

=== Mercurial Man Pages ===

rst2html (from docutils) is used to build HTML man pages. 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 > cd sphinx > python 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: 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 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 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 --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 assumes that .py files are registered with Windows so that they can execute directly. That is, entering --help

(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 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.