readme.rst
1Requirements
2============
3
4Building the Inno installer requires a Windows machine.
5
6The following system dependencies must be installed:
7
8* Python 2.7 (download from https://www.python.org/downloads/)
9* Microsoft Visual C++ Compiler for Python 2.7
10 (https://www.microsoft.com/en-us/download/details.aspx?id=44266)
11* Inno Setup (http://jrsoftware.org/isdl.php) version 5.4 or newer.
12 Be sure to install the optional Inno Setup Preprocessor feature,
13 which is required.
14* Python 3.5+ (to run the ``packaging.py`` script)
15
16Building
17========
18
19The ``packaging.py`` script automates the process of producing an
20Inno installer. It manages fetching and configuring the
21non-system dependencies (such as py2exe, gettext, and various
22Python packages).
23
24The script requires an activated ``Visual C++ 2008`` command prompt.
25A shortcut to such a prompt was installed with ``Microsoft Visual C++
26Compiler for Python 2.7``. From your Start Menu, look for
27``Microsoft Visual C++ Compiler Package for Python 2.7`` then launch
28either ``Visual C++ 2008 32-bit Command Prompt`` or
29``Visual C++ 2008 64-bit Command Prompt``.
30
31From the prompt, change to the Mercurial source directory. e.g.
32``cd c:\src\hg``.
33
34Next, invoke ``packaging.py`` to produce an Inno installer. You will
35need to supply the path to the Python interpreter to use.::
36
37 $ py -3 contrib\packaging\packaging.py \
38 inno --python c:\python27\python.exe
39
40.. note::
41
42 The script validates that the Visual C++ environment is
43 active and that the architecture of the specified Python
44 interpreter matches the Visual C++ environment and errors
45 if not.
46
47If everything runs as intended, dependencies will be fetched and
48configured into the ``build`` sub-directory, Mercurial will be built,
49and an installer placed in the ``dist`` sub-directory. The final
50line of output should print the name of the generated installer.
51
52Additional options may be configured. Run
53``packaging.py inno --help`` to see a list of program flags.
54
55MinGW
56=====
57
58It is theoretically possible to generate an installer that uses
59MinGW. This isn't well tested and ``packaging.py`` and may properly
60support it. See old versions of this file in version control for
61potentially useful hints as to how to achieve this.
62