contrib/packaging/wix/readme.rst
author Pulkit Goyal <7895pulkit@gmail.com>
Fri, 20 Nov 2020 14:34:15 +0530
changeset 45920 1441f4d57083
parent 43513 081a77df7bc6
child 46450 e933e66153f3
permissions -rw-r--r--
dispatch: pass root path in ui.readconfig() as root of main repo Since we are reading main (shared-source) repository config options, we should pass root as that repository root only. Differential Revision: https://phab.mercurial-scm.org/D9359
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41921
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
     1
WiX Installer
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
     2
=============
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
     3
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
     4
The files in this directory are used to produce an MSI installer using
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
     5
the WiX Toolset (http://wixtoolset.org/).
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
     6
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
     7
The MSI installers require elevated (admin) privileges due to the
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
     8
installation of MSVC CRT libraries into the Windows system store. See
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
     9
the Inno Setup installers in the ``inno`` sibling directory for installers
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    10
that do not have this requirement.
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    11
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    12
Requirements
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    13
============
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    14
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    15
Building the WiX installers requires a Windows machine. The following
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    16
dependencies must be installed:
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    17
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    18
* Python 2.7 (download from https://www.python.org/downloads/)
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    19
* Microsoft Visual C++ Compiler for Python 2.7
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    20
  (https://www.microsoft.com/en-us/download/details.aspx?id=44266)
43513
081a77df7bc6 packaging: consolidate CLI functionality into packaging.py
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41921
diff changeset
    21
* Python 3.5+ (to run the ``packaging.py`` script)
41921
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    22
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    23
Building
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    24
========
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    25
43513
081a77df7bc6 packaging: consolidate CLI functionality into packaging.py
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41921
diff changeset
    26
The ``packaging.py`` script automates the process of producing an MSI
41921
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    27
installer. It manages fetching and configuring non-system dependencies
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    28
(such as py2exe, gettext, and various Python packages).
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    29
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    30
The script requires an activated ``Visual C++ 2008`` command prompt.
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    31
A shortcut to such a prompt was installed with ``Microsoft Visual
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    32
C++ Compiler for Python 2.7``. From your Start Menu, look for
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    33
``Microsoft Visual C++ Compiler Package for Python 2.7`` then
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    34
launch either ``Visual C++ 2008 32-bit Command Prompt`` or
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    35
``Visual C++ 2008 64-bit Command Prompt``.
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    36
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    37
From the prompt, change to the Mercurial source directory. e.g.
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    38
``cd c:\src\hg``.
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    39
43513
081a77df7bc6 packaging: consolidate CLI functionality into packaging.py
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41921
diff changeset
    40
Next, invoke ``packaging.py`` to produce an MSI installer. You will need
41921
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    41
to supply the path to the Python interpreter to use.::
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    42
43513
081a77df7bc6 packaging: consolidate CLI functionality into packaging.py
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41921
diff changeset
    43
   $ python3 contrib\packaging\packaging.py \
081a77df7bc6 packaging: consolidate CLI functionality into packaging.py
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41921
diff changeset
    44
      wix --python c:\python27\python.exe
41921
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    45
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    46
.. note::
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    47
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    48
   The script validates that the Visual C++ environment is active and
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    49
   that the architecture of the specified Python interpreter matches the
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    50
   Visual C++ environment. An error is raised otherwise.
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    51
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    52
If everything runs as intended, dependencies will be fetched and
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    53
configured into the ``build`` sub-directory, Mercurial will be built,
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    54
and an installer placed in the ``dist`` sub-directory. The final line
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    55
of output should print the name of the generated installer.
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    56
43513
081a77df7bc6 packaging: consolidate CLI functionality into packaging.py
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41921
diff changeset
    57
Additional options may be configured. Run ``packaging.py wix --help`` to
081a77df7bc6 packaging: consolidate CLI functionality into packaging.py
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41921
diff changeset
    58
see a list of program flags.
41921
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    59
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    60
Relationship to TortoiseHG
10502
1e022c88a0a5 Add WiX installer scripts to contrib/wix
Steve Borho <steve@borho.org>
parents:
diff changeset
    61
==========================
1e022c88a0a5 Add WiX installer scripts to contrib/wix
Steve Borho <steve@borho.org>
parents:
diff changeset
    62
41921
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    63
TortoiseHG uses the WiX files in this directory.
10502
1e022c88a0a5 Add WiX installer scripts to contrib/wix
Steve Borho <steve@borho.org>
parents:
diff changeset
    64
41921
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    65
The code for building TortoiseHG installers lives at
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    66
https://bitbucket.org/tortoisehg/thg-winbuild and is maintained by
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    67
Steve Borho (steve@borho.org).
10502
1e022c88a0a5 Add WiX installer scripts to contrib/wix
Steve Borho <steve@borho.org>
parents:
diff changeset
    68
41921
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    69
When changing behavior of the WiX installer, be sure to notify
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    70
the TortoiseHG Project of the changes so they have ample time
4371f543efda wix: functionality to automate building WiX installers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 41920
diff changeset
    71
provide feedback and react to those changes.