contrib/win32/win32-build.txt
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Thu, 02 Sep 2010 14:58:47 +0200
changeset 12148 0a0592f8e11a
parent 10976 5ff192fb09ff
child 12262 df5386ae41b9
permissions -rw-r--r--
tests: unify test-convert-hg-startrev.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     1
The standalone Windows installer for Mercurial is built in a somewhat
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     2
jury-rigged fashion.
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     3
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     4
It has the following prerequisites, at least as I build it:
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     5
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     6
  Python for Windows
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
     7
      http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     8
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     9
  MinGW
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    10
      http://www.mingw.org/
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    11
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    12
  Python for Windows Extensions
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    13
      http://sourceforge.net/projects/pywin32/
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    14
8058
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    15
  mfc71.dll (just download, don't install; not needed for Python 2.6)
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    16
      http://starship.python.net/crew/mhammond/win32/
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    17
8058
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    18
  Visual C++ 2008 redistributable package (needed for Python 2.6)
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    19
      http://www.microsoft.com/downloads/details.aspx?familyid=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    20
      
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    21
  The py2exe distutils extension
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    22
      http://sourceforge.net/projects/py2exe/
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    23
9175
22979282d8ca Mention GnuWin32 gettext in win32 build instructions
Patrick Mezard <pmezard@gmail.com>
parents: 8058
diff changeset
    24
  GnuWin32 gettext utility
22979282d8ca Mention GnuWin32 gettext in win32 build instructions
Patrick Mezard <pmezard@gmail.com>
parents: 8058
diff changeset
    25
      http://gnuwin32.sourceforge.net/packages/gettext.htm
22979282d8ca Mention GnuWin32 gettext in win32 build instructions
Patrick Mezard <pmezard@gmail.com>
parents: 8058
diff changeset
    26
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    27
  Inno Setup
9356
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
    28
      http://www.jrsoftware.org/isdl.php#qsp
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
    29
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
    30
      Get and install ispack-5.3.4.exe which includes Inno Setup Processor,
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
    31
      which is necessary to package Mercurial.
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    32
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    33
  ISTool - optional
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    34
      http://www.istool.org/default.aspx/
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    35
2384
068b32d06873 Automatically add the path of hg to %PATH% using add_path
Marco Barisione <marco@barisione.org>
parents: 1291
diff changeset
    36
  add_path (you need only add_path.exe in the zip file)
068b32d06873 Automatically add the path of hg to %PATH% using add_path
Marco Barisione <marco@barisione.org>
parents: 1291
diff changeset
    37
      http://www.barisione.org/apps.html#add_path
068b32d06873 Automatically add the path of hg to %PATH% using add_path
Marco Barisione <marco@barisione.org>
parents: 1291
diff changeset
    38
9179
9e5e2e07cf81 Update win32 build instructions for rst2html
Patrick Mezard <pmezard@gmail.com>
parents: 9175
diff changeset
    39
  Docutils
9e5e2e07cf81 Update win32 build instructions for rst2html
Patrick Mezard <pmezard@gmail.com>
parents: 9175
diff changeset
    40
      http://docutils.sourceforge.net/
7660
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
    41
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    42
And, of course, Mercurial itself.
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    43
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    44
Once you have all this installed and built, clone a copy of the
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    45
Mercurial repository you want to package, and name the repo
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    46
C:\hg\hg-release.
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    47
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    48
In a shell, build a standalone copy of the hg.exe program:
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    49
5081
ea7b982b6c08 Remove trailing spaces
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4401
diff changeset
    50
  python setup.py build -c mingw32
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    51
  python setup.py py2exe -b 1
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    52
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    53
Note: the previously suggested combined command of "python setup.py build -c
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    54
mingw32 py2exe -b 1" doesn't work correctly anymore as it doesn't include the
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    55
extensions in the mercurial subdirectory.
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    56
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    57
If you want to create a file named setup.cfg with the contents:
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    58
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    59
[build]
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    60
compiler=mingw32
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    61
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    62
you can skip the first build step.
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    63
8058
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    64
Copy add_path.exe into the dist directory that just got created.
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    65
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    66
If you are using Python up to version 2.5.4, copy mfc71.dll into the dist
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    67
directory that just got created.
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    68
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    69
If you are using Python 2.6 or later, after installing the Visual C++ 2008
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    70
redistributable package copy into the dist directory that just got created the
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    71
following files:
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    72
  - from the directory starting with
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    73
    Windows/WinSxS/x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    74
    the files named: msvcm90.dll, msvcp90.dll and msvcr90.dll
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    75
  - from the directory starting with
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    76
    Windows/WinSxS/x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    77
    the files named: mfc90.dll, mfc90u.dll, mfcm90.dll and mfcm90u.dll
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    78
  - from the directory named Windows/WinSxS/Manifests, the manifest file
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    79
    starting with x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    80
    (rename it to Microsoft.VC90.CRT.manifest) and the manifest file starting
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    81
    with x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8 (rename it to
a0555ae394b3 Add Python 2.6 support to win32 installer
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7660
diff changeset
    82
    Microsoft.VC90.MFC.manifest)
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    83
7660
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
    84
Before building the installer, you have to build Mercurial HTML documentation 
10976
5ff192fb09ff contrib/win32: update build instructions after cbe400a8e217
Martin Geisler <mg@lazybytes.net>
parents: 9358
diff changeset
    85
(or fix mercurial.iss to not reference the doc directory):
7660
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
    86
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
    87
  cd doc
10976
5ff192fb09ff contrib/win32: update build instructions after cbe400a8e217
Martin Geisler <mg@lazybytes.net>
parents: 9358
diff changeset
    88
  mingw32-make html
7660
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
    89
  cd ..
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
    90
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    91
If you use ISTool, you open the C:\hg\hg-release\contrib\win32\mercurial.iss
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    92
file and type Ctrl-F9 to compile the installer file.
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    93
9356
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
    94
Otherwise you run the Inno Setup compiler.  Assuming it's in the path
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
    95
you should execute:
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    96
9356
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
    97
  iscc contrib\win32\mercurial.iss /DVERSION=foo
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
    98
9356
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
    99
Where 'foo' is the version number you would like to see in the
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
   100
'Add/Remove Applications' tool.  The installer will be placed into
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
   101
a directory named Output/ at the root of your repository.
1291
a942bf419a64 Document Windows installer build process.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
   102
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
   103
To automate the steps above you may want to create a batchfile based on the
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
   104
following:
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
   105
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
   106
  echo [build] > setup.cfg
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
   107
  echo compiler=mingw32 >> setup.cfg
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
   108
  python setup.py py2exe -b 1
7660
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
   109
  cd doc
10976
5ff192fb09ff contrib/win32: update build instructions after cbe400a8e217
Martin Geisler <mg@lazybytes.net>
parents: 9358
diff changeset
   110
  mingw32-make html
7660
ceed5f8c4ebf Document how HTML documentation is built under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 5081
diff changeset
   111
  cd ..
9356
9488a4d64fb5 iss: take version from iscc command line or __version__.py
Steve Borho <steve@borho.org>
parents: 9175
diff changeset
   112
  iscc contrib\win32\mercurial.iss /DVERSION=snapshot
4401
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
   113
d1dd16256114 Update Windows build instructions.
Lee Cantey <lcantey@gmail.com>
parents: 2384
diff changeset
   114
and run it from the root of the hg repository (c:\hg\hg-release).