contrib/packaging/inno/readme.rst
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 07 Mar 2019 12:15:32 -0800
changeset 41916 260305e8ddbd
parent 41854 7a1433e90482
child 42607 8f7c3f43e3ac
permissions -rw-r--r--
setup: configure py2exe config via environment variables The Inno Setup and WiX installers ship a different set of packages with py2exe builds. And there are multiple WiX installer variants (e.g. TortoiseHG). Since there are multiple variants of py2exe configs and they can be defined by entities not in our repository, let's provide a mechanism for setup.py to supplement behavior via environment variables. This is slighly less hacky than a setup.cfg file IMO since the caller doesn't need to worry about mutating global state of the source directory. Differential Revision: https://phab.mercurial-scm.org/D6092
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
     1
Requirements
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
     2
============
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     3
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
     4
Building the Inno installer requires a Windows machine.
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     5
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
     6
The following system dependencies must be installed:
18960
170fc0949fb6 check-code: check txt files for trailing whitespace
Mads Kiilerich <madski@unity3d.com>
parents: 13246
diff changeset
     7
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
     8
* Python 2.7 (download from https://www.python.org/downloads/)
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
     9
* Microsoft Visual C++ Compiler for Python 2.7
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    10
  (https://www.microsoft.com/en-us/download/details.aspx?id=44266)
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    11
* Inno Setup (http://jrsoftware.org/isdl.php) version 5.4 or newer.
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    12
  Be sure to install the optional Inno Setup Preprocessor feature,
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    13
  which is required.
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    14
* Python 3.5+ (to run the ``build.py`` script)
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    15
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    16
Building
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    17
========
7660
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
    18
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    19
The ``build.py`` script automates the process of producing an
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    20
Inno installer. It manages fetching and configuring the
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    21
non-system dependencies (such as py2exe, gettext, and various
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    22
Python packages).
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    23
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    24
The script requires an activated ``Visual C++ 2008`` command prompt.
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    25
A shortcut to such a prompt was installed with ``Microsoft Visual C++
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    26
Compiler for Python 2.7``. From your Start Menu, look for
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    27
``Microsoft Visual C++ Compiler Package for Python 2.7`` then launch
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    28
either ``Visual C++ 2008 32-bit Command Prompt`` or
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    29
``Visual C++ 2008 64-bit Command Prompt``.
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    30
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    31
From the prompt, change to the Mercurial source directory. e.g.
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    32
``cd c:\src\hg``.
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    33
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    34
Next, invoke ``build.py`` to produce an Inno installer. You will
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    35
need to supply the path to the Python interpreter to use.:
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    36
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    37
   $ python3.exe contrib\packaging\inno\build.py \
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    38
       --python c:\python27\python.exe
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    39
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    40
.. note::
7660
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
    41
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    42
   The script validates that the Visual C++ environment is
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    43
   active and that the architecture of the specified Python
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    44
   interpreter matches the Visual C++ environment and errors
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    45
   if not.
7660
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
    46
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    47
If everything runs as intended, dependencies will be fetched and
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    48
configured into the ``build`` sub-directory, Mercurial will be built,
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    49
and an installer placed in the ``dist`` sub-directory. The final
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    50
line of output should print the name of the generated installer.
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    51
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    52
Additional options may be configured. Run ``build.py --help`` to
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    53
see a list of program flags.
12263
5f19416056b4 win32: 64-bit Inno Setup installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 12262
diff changeset
    54
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    55
MinGW
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    56
=====
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    57
41853
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    58
It is theoretically possible to generate an installer that uses
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    59
MinGW. This isn't well tested and ``build.py`` and may properly
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    60
support it. See old versions of this file in version control for
d7dc4ac1ff84 inno: script to automate building Inno installer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41849
diff changeset
    61
potentially useful hints as to how to achieve this.