contrib/packaging/inno/readme.txt
changeset 41853 d7dc4ac1ff84
parent 41852 db3098d02a6d
child 41854 7a1433e90482
equal deleted inserted replaced
41852:db3098d02a6d 41853:d7dc4ac1ff84
     1 The standalone Windows installer for Mercurial is built in a somewhat
       
     2 jury-rigged fashion.
       
     3 
       
     4 It has the following prerequisites. Ensure to take the packages
       
     5 matching the mercurial version you want to build (32-bit or 64-bit).
       
     6 
       
     7   Python 2.6 for Windows
       
     8       http://www.python.org/download/releases/
       
     9 
       
    10   A compiler:
       
    11     either MinGW
       
    12       http://www.mingw.org/
       
    13     or Microsoft Visual C++ 2008 SP1 Express Edition
       
    14       http://www.microsoft.com/express/Downloads/Download-2008.aspx
       
    15 
       
    16   mfc71.dll (just download, don't install; not needed for Python 2.6)
       
    17       http://starship.python.net/crew/mhammond/win32/
       
    18 
       
    19   Visual C++ 2008 redistributable package (needed for >= Python 2.6 or if you compile with MSVC)
       
    20     for 32-bit:
       
    21       http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf
       
    22     for 64-bit:
       
    23       http://www.microsoft.com/downloads/details.aspx?familyid=bd2a6171-e2d6-4230-b809-9a8d7548c1b6
       
    24 
       
    25   The py2exe distutils extension
       
    26       http://sourceforge.net/projects/py2exe/
       
    27 
       
    28   GnuWin32 gettext utility (if you want to build translations)
       
    29       http://gnuwin32.sourceforge.net/packages/gettext.htm
       
    30 
       
    31   Inno Setup
       
    32       http://www.jrsoftware.org/isdl.php#qsp
       
    33 
       
    34       Get and install ispack-5.3.10.exe or later (includes Inno Setup Processor),
       
    35       which is necessary to package Mercurial.
       
    36 
       
    37   ISTool - optional
       
    38       http://www.istool.org/default.aspx/
       
    39 
       
    40   Docutils
       
    41       http://docutils.sourceforge.net/
       
    42 
       
    43 And, of course, Mercurial itself.
       
    44 
       
    45 Once you have all this installed and built, clone a copy of the
       
    46 Mercurial repository you want to package, and name the repo
       
    47 C:\hg\hg-release.
       
    48 
       
    49 In a shell, build a standalone copy of the hg.exe program.
       
    50 
       
    51 Building instructions for MinGW:
       
    52   python setup.py build -c mingw32
       
    53   python setup.py py2exe -b 2
       
    54 Note: the previously suggested combined command of "python setup.py build -c
       
    55 mingw32 py2exe -b 2" doesn't work correctly anymore as it doesn't include the
       
    56 extensions in the mercurial subdirectory.
       
    57 If you want to create a file named setup.cfg with the contents:
       
    58 [build]
       
    59 compiler=mingw32
       
    60 you can skip the first build step.
       
    61 
       
    62 Building instructions with MSVC 2008 Express Edition:
       
    63   for 32-bit:
       
    64     "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
       
    65     python setup.py py2exe -b 2
       
    66   for 64-bit:
       
    67     "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64
       
    68     python setup.py py2exe -b 3
       
    69 
       
    70 If you are using Python 2.6 or later, or if you are using MSVC 2008 to compile
       
    71 mercurial, you must include the C runtime libraries in the installer. To do so,
       
    72 install the Visual C++ 2008 redistributable package. Then in your windows\winsxs
       
    73 folder, locate the folder containing the dlls version 9.0.21022.8.
       
    74 For x86, it should be named like x86_Microsoft.VC90.CRT_(...)_9.0.21022.8(...).
       
    75 For x64, it should be named like amd64_Microsoft.VC90.CRT_(...)_9.0.21022.8(...).
       
    76 Copy the files named msvcm90.dll, msvcp90.dll and msvcr90.dll into the dist
       
    77 directory.
       
    78 Then in the windows\winsxs\manifests folder, locate the corresponding manifest
       
    79 file (x86_Microsoft.VC90.CRT_(...)_9.0.21022.8(...).manifest for x86,
       
    80 amd64_Microsoft.VC90.CRT_(...)_9.0.21022.8(...).manifest for x64), copy it in the
       
    81 dist directory and rename it to Microsoft.VC90.CRT.manifest.
       
    82 
       
    83 Before building the installer, you have to build Mercurial HTML documentation
       
    84 (or fix mercurial.iss to not reference the doc directory):
       
    85 
       
    86   cd doc
       
    87   mingw32-make html
       
    88   cd ..
       
    89 
       
    90 If you use ISTool, you open the
       
    91 C:\hg\hg-release\contrib\packaging\inno-installer\mercurial.iss
       
    92 file and type Ctrl-F9 to compile the installer file.
       
    93 
       
    94 Otherwise you run the Inno Setup compiler.  Assuming it's in the path
       
    95 you should execute:
       
    96 
       
    97   iscc contrib\packaging\inno-installer\mercurial.iss /dVERSION=foo
       
    98 
       
    99 Where 'foo' is the version number you would like to see in the
       
   100 'Add/Remove Applications' tool.  The installer will be placed into
       
   101 a directory named Output/ at the root of your repository.
       
   102 If the /dVERSION=foo parameter is not given in the command line, the
       
   103 installer will retrieve the version information from the __version__.py file.
       
   104 
       
   105 If you want to build an installer for a 64-bit mercurial, add /dARCH=x64 to
       
   106 your command line:
       
   107   iscc contrib\packaging\inno-installer\mercurial.iss /dARCH=x64
       
   108 
       
   109 To automate the steps above you may want to create a batchfile based on the
       
   110 following (MinGW build chain):
       
   111 
       
   112   echo [build] > setup.cfg
       
   113   echo compiler=mingw32 >> setup.cfg
       
   114   python setup.py py2exe -b 2
       
   115   cd doc
       
   116   mingw32-make html
       
   117   cd ..
       
   118   iscc contrib\packaging\inno-installer\mercurial.iss /dVERSION=snapshot
       
   119 
       
   120 and run it from the root of the hg repository (c:\hg\hg-release).