wix: switch Mercurial Windows installer to use py2exe --bundle 3 stable
authorSteve Borho <steve@borho.org>
Fri, 26 Nov 2010 16:18:19 -0600
branchstable
changeset 13041 79388a8325dc
parent 13039 dd24f3e7ca9e
child 13042 bd9bc4123920
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.
contrib/wix/dist.wxs
contrib/wix/guids.wxi
contrib/wix/hg.cmd
contrib/wix/mercurial.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>
--- a/contrib/wix/guids.wxi	Tue Nov 23 13:11:40 2010 +0100
+++ 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>
--- /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 @@
+@echo off
+rem launch hg.exe from parent folder
+"%~dp0\..\hg.exe" %*
--- a/contrib/wix/mercurial.wxs	Tue Nov 23 13:11:40 2010 +0100
+++ 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' />