[PATCH 1 of 2] wix: switch Mercurial Windows installer to use py2exe --bundle 3

Steve Borho steve at borho.org
Fri Nov 26 17:58:29 CST 2010


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1290809899 21600
# Branch stable
# Node ID 264b201530179e27b98995660f7340d8754b782d
# Parent  f08df4d38442bf641859f3de860ce0e5b6ba7763
wix: switch Mercurial Windows installer to use py2exe --bundle 3

--bundle 3 leaves all of the compiled C extensions and other DLLs outside of
the library.zip, so we no longer add the installer folder to the system PATH.
Instead, we now ship a small bin/hg.cmd and it is placed in the PATH.

Switching to py2exe --bundle 3 is necessary because the higher bundle options
are not supported on x64.

diff -r f08df4d38442 -r 264b20153017 contrib/wix/dist.wxs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/wix/dist.wxs	Fri Nov 26 16:18:19 2010 -0600
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+
+  <?include guids.wxi ?>
+
+  <Fragment>
+    <DirectoryRef Id="INSTALLDIR" FileSource="$(var.SourceDir)">
+      <Component Id="distOutput" Guid="$(var.dist.guid)">
+        <File Name="library.zip" KeyPath="yes" />
+        <File Name="mercurial.base85.pyd" />
+        <File Name="mercurial.bdiff.pyd" />
+        <File Name="mercurial.diffhelpers.pyd" />
+        <File Name="mercurial.mpatch.pyd" />
+        <File Name="mercurial.osutil.pyd" />
+        <File Name="mercurial.parsers.pyd" />
+        <File Name="pyexpat.pyd" />
+        <File Name="python26.dll" />
+        <File Name="pythoncom26.dll" />
+        <File Name="pywintypes26.dll" />
+        <File Name="bz2.pyd" />
+        <File Name="select.pyd" />
+        <File Name="unicodedata.pyd" />
+        <File Name="win32api.pyd" />
+        <File Name="win32com.shell.shell.pyd" />
+        <File Name="win32console.pyd" />
+        <File Name="win32file.pyd" />
+        <File Name="win32gui.pyd" />
+        <File Name="win32pipe.pyd" />
+        <File Name="win32process.pyd" />
+        <File Name="_elementtree.pyd" />
+        <File Name="_hashlib.pyd" />
+        <File Name="_socket.pyd" />
+        <File Name="_ssl.pyd" />
+        <File Name="_win32sysloader.pyd" />
+      </Component>
+    </DirectoryRef>
+  </Fragment>
+
+</Wix>
diff -r f08df4d38442 -r 264b20153017 contrib/wix/guids.wxi
--- a/contrib/wix/guids.wxi	Tue Nov 16 13:06:07 2010 -0600
+++ b/contrib/wix/guids.wxi	Fri Nov 26 16:18:19 2010 -0600
@@ -8,6 +8,9 @@
   <?define contrib.guid = {F17D27B7-4A6B-4cd2-AE72-FED3CFAA585E} ?>
   <?define contrib.vim.guid = {BB04903A-652D-4C4F-9590-2BD07A2304F2} ?>
 
+  <!-- dist.wxs -->
+  <?define dist.guid = {0F63D160-0740-4BAF-BF25-0C6930310F51} ?>
+
   <!-- doc.wxs -->
   <?define doc.hg.1.html.guid = {AAAA3FDA-EDC5-4220-B59D-D342722358A2} ?>
   <?define doc.hgignore.5.html.guid = {AA9118C4-F3A0-4429-A5F4-5A1906B2D67F} ?>
@@ -42,5 +45,6 @@
   <?define mercurial.rc.guid = {1D5FAEEE-7E6E-43B1-9F7F-802714316B15} ?>
   <?define mergetools.rc.guid = {E8A1DC29-FF40-4B5F-BD12-80B9F7BF0CCD} ?>
   <?define ProgramMenuDir.guid = {D5A63320-1238-489B-B68B-CF053E9577CA} ?>
+  <?define hgcmd.guid = {65CCC756-E72E-4C5F-901E-D575EDC80DB3} ?>
 
 </Include>
diff -r f08df4d38442 -r 264b20153017 contrib/wix/hg.cmd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/wix/hg.cmd	Fri Nov 26 16:18:19 2010 -0600
@@ -0,0 +1,3 @@
+ at echo off
+rem launch hg.exe from parent folder
+"%~dp0\..\hg.exe" %*
diff -r f08df4d38442 -r 264b20153017 contrib/wix/mercurial.wxs
--- a/contrib/wix/mercurial.wxs	Tue Nov 16 13:06:07 2010 -0600
+++ b/contrib/wix/mercurial.wxs	Fri Nov 26 16:18:19 2010 -0600
@@ -8,6 +8,12 @@
 
   <?include guids.wxi ?>
 
+  <?if $(var.Platform) = "x64" ?>
+    <?define IsX64 = yes ?>
+  <?else?>
+    <?define IsX64 = no ?>
+  <?endif?>
+
   <Product Id='*'
     Name='Mercurial $(var.Version)' 
     UpgradeCode='$(var.ProductUpgradeCode)'
@@ -52,10 +58,8 @@
         <Directory Id='INSTALLDIR' Name='Mercurial'>
           <Component Id='MainExecutable' Guid='$(var.ComponentMainExecutableGUID)'>
             <File Id='hgEXE' Name='hg.exe' Source='dist\hg.exe' KeyPath='yes' />
-            <File Id='libraryZIP' Name='library.zip' Source='dist\library.zip' />
-            <File Id='pythonDLL' Name='python26.dll' Source='dist\python26.dll' />
             <Environment Id="Environment" Name="PATH" Part="last" System="yes"
-                         Permanent="no" Value="[INSTALLDIR]" Action="set" />
+                         Permanent="no" Value="[INSTALLDIR]bin" Action="set" />
           </Component>
           <Component Id='ReadMe' Guid='$(var.ReadMe.guid)'>
               <File Id='ReadMe' Name='ReadMe.html' Source='contrib\win32\ReadMe.html'
@@ -65,6 +69,7 @@
             <File Id='COPYING' Name='COPYING.rtf' Source='contrib\wix\COPYING.rtf'
                   KeyPath='yes'/>
           </Component>
+
           <Directory Id='HGRCD' Name='hgrc.d'>
             <Component Id='mercurial.rc' Guid='$(var.mercurial.rc.guid)'>
               <File Id='mercurial.rc' Name='Mercurial.rc' Source='contrib\win32\mercurial.ini'
@@ -75,6 +80,12 @@
                     ReadOnly='yes' KeyPath='yes'/>
             </Component>
           </Directory>
+
+          <Directory Id='binFolder' Name='bin'>
+            <Component Id='HgCmd' Guid='$(var.hgcmd.guid)'>
+                <File Id='Hg.Cmd' Name='hg.cmd' KeyPath='yes' Source='contrib\wix\hg.cmd' />
+            </Component>
+          </Directory>
         </Directory>
       </Directory>
 
@@ -101,12 +112,14 @@
       <Feature Id='MainProgram' Title='Program' Description='Mercurial command line app'
              Level='1' Absent='disallow' >
         <ComponentRef Id='MainExecutable' />
+        <ComponentRef Id='distOutput' />
         <ComponentRef Id='ProgramMenuDir' />
         <ComponentRef Id='ReadMe' />
         <ComponentRef Id='COPYING' />
         <ComponentRef Id='mercurial.rc' />
         <ComponentRef Id='mergetools.rc' />
         <ComponentRef Id='helpFolder' />
+        <ComponentRef Id='HgCmd' />
         <ComponentGroupRef Id='templatesFolder' />
         <MergeRef Id='VCRuntime' />
         <MergeRef Id='VCRuntimePolicy' />


More information about the Mercurial-devel mailing list