[PATCH 2 of 2] win32: 64-bit Inno Setup installer

Pascal Quantin pascal.quantin at gmail.com
Sat Sep 11 11:56:16 CDT 2010

# HG changeset patch
# User Pascal Quantin <pascal.quantin at gmail.com>
# Date 1284223683 -7200
# Node ID 756895a2275bae2bcd6393b5e9206561d4d8b493
# Parent  17b8161eee1554a3f723d497fdb21983d418d499
win32: 64-bit Inno Setup installer

diff --git a/contrib/win32/mercurial.iss b/contrib/win32/mercurial.iss
--- a/contrib/win32/mercurial.iss
+++ b/contrib/win32/mercurial.iss
@@ -16,10 +16,22 @@
 #pragma message "Detected Version: " + VERSION
+#ifndef ARCH
+#define ARCH = "x86"
 AppCopyright=Copyright 2005-2010 Matt Mackall and others
+#if ARCH == "x64"
+AppVerName=Mercurial {#VERSION} (64-bit)
 AppVerName=Mercurial {#VERSION}
@@ -29,7 +41,6 @@
 AppContact=mercurial at selenic.com
 VersionInfoDescription=Mercurial distributed SCM (version {#VERSION})
@@ -61,11 +72,16 @@
 Source: contrib\win32\mercurial.ini; DestDir: {app}; DestName: Mercurial.ini; Check: CheckFile; AfterInstall: ConcatenateFiles;
 Source: contrib\win32\postinstall.txt; DestDir: {app}; DestName: ReleaseNotes.txt
 Source: dist\hg.exe; DestDir: {app}; AfterInstall: Touch('{app}\hg.exe.local')
+#if ARCH == "x64"
+Source: dist\*.dll; Destdir: {app}
+Source: dist\*.pyd; Destdir: {app}
 Source: dist\python*.dll; Destdir: {app}; Flags: skipifsourcedoesntexist
+Source: dist\msvc*.dll; DestDir: {app}; Flags: skipifsourcedoesntexist
+Source: dist\w9xpopen.exe; DestDir: {app}
+Source: dist\Microsoft.VC*.CRT.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist
 Source: dist\library.zip; DestDir: {app}
-Source: dist\msvc*.dll; DestDir: {app}; Flags: skipifsourcedoesntexist
-Source: dist\Microsoft.VC*.CRT.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist
-Source: dist\w9xpopen.exe; DestDir: {app}
 Source: dist\add_path.exe; DestDir: {app}
 Source: doc\*.html; DestDir: {app}\Docs
 Source: doc\style.css; DestDir: {app}\Docs
diff --git a/contrib/win32/win32-build.txt b/contrib/win32/win32-build.txt
--- a/contrib/win32/win32-build.txt
+++ b/contrib/win32/win32-build.txt
@@ -1,7 +1,8 @@
 The standalone Windows installer for Mercurial is built in a somewhat
 jury-rigged fashion.
-It has the following prerequisites, at least as I build it:
+It has the following prerequisites. Ensure to take the packages
+matching the mercurial version you want to build (32-bit or 64-bit).
   Python 2.6 for Windows
@@ -19,7 +20,10 @@
   Visual C++ 2008 SP1 redistributable package (needed for >= Python 2.6 or if you compile with MSVC)
+    for 32-bit:
+    for 64-bit:
+      http://www.microsoft.com/downloads/details.aspx?familyid=BA9257CA-337F-4B40-8C14-157CFDFFEE4E
   The py2exe distutils extension
@@ -62,7 +66,12 @@
 you can skip the first build step.
 Building instructions with MSVC 2008 SP1 Express Edition:
-  python setup.py py2exe -b 2
+  for 32-bit:
+    "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
+    python setup.py py2exe -b 2
+  for 64-bit:
+    "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64
+    python setup.py py2exe -b 3
 Copy add_path.exe into the dist directory that just got created.
@@ -74,11 +83,13 @@
 install the Visual C++ 2008 SP1 redistributable package. Then in your
 windows\winsxs folder, locate the folder containing the dlls version 9.0.30729.
 For x86, it should be named like x86_Microsoft.VC90.CRT_(...)_9.0.30729(...).
+For x64, it should be named like amd64_Microsoft.VC90.CRT_(...)_9.0.30729(...).
 Copy the files named msvcm90.dll, msvcp90.dll and msvcr90.dll into the dist
 Then in the windows\winsxs\manifests folder, locate the corresponding manifest
-file (x86_Microsoft.VC90.CRT_(...)_9.0.30729(...).manifest for x86), copy it in
-the dist directory and rename it to Microsoft.VC90.CRT.manifest.
+file (x86_Microsoft.VC90.CRT_(...)_9.0.30729(...).manifest for x86,
+amd64_Microsoft.VC90.CRT_(...)_9.0.30729(...).manifest for x64), copy it in the
+dist directory and rename it to Microsoft.VC90.CRT.manifest.
 Before building the installer, you have to build Mercurial HTML documentation 
 (or fix mercurial.iss to not reference the doc directory):
@@ -101,6 +112,10 @@
 If the /dVERSION=foo parameter is not given in the command line, the
 installer will retrieve the version information from the __version__.py file.
+If you want to build an installer for a 64-bit mercurial, add /dARCH=x64 to
+your command line:
+  iscc contrib\win32\mercurial.iss /dARCH=x64
 To automate the steps above you may want to create a batchfile based on the
 following (MinGW build chain):

More information about the Mercurial-devel mailing list