Author: Matti Picus <matti.pi...@gmail.com>
Branch: wininstaller_py2
Changeset: r98025:8e4c447b8d6c
Date: 2019-11-11 08:22 -0500
http://bitbucket.org/pypy/pypy/changeset/8e4c447b8d6c/

Log:    adjust for python2

diff --git a/PCbuild/python.props b/PCbuild/python.props
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -64,7 +64,7 @@
     <PyArchExt Condition="'$(ArchName)' == 'win32'">-32</PyArchExt>
     
     <!-- Full path of the resulting python.exe binary -->
-    <PythonExe Condition="'$(PythonExe)' == 
''">$(InterpreterPath)pypy3-c$(PyDebugExt).exe</PythonExe>
+    <PythonExe Condition="'$(PythonExe)' == 
''">$(InterpreterPath)pypy-c$(PyDebugExt).exe</PythonExe>
   </PropertyGroup>
   
   <PropertyGroup Condition="$(DefaultWindowsSDKVersion) == ''">
@@ -99,7 +99,7 @@
         ReleaseLevelNumber  -   10 for alpha, 11 for beta, 12 for RC (gamma), 
and 15 for final
         Field3Value         -   2101 for '3.5.2a1' (== 1000*2 + 10*10 ('a') + 
1)
     -->
-    
<_PatchLevelContent>$([System.IO.File]::ReadAllText(`$(PySourcePath)Include\patchlevel.h`))</_PatchLevelContent>
+    
<_PatchLevelContent>$([System.IO.File]::ReadAllText(`$(PySourcePath)pypy\module\cpyext\include\patchlevel.h`))</_PatchLevelContent>
     
<MajorVersionNumber>$([System.Text.RegularExpressions.Regex]::Match($(_PatchLevelContent),
 `define\s+PY_MAJOR_VERSION\s+(\d+)`).Groups[1].Value)</MajorVersionNumber>
     
<MinorVersionNumber>$([System.Text.RegularExpressions.Regex]::Match($(_PatchLevelContent),
 `define\s+PY_MINOR_VERSION\s+(\d+)`).Groups[1].Value)</MinorVersionNumber>
     
<MicroVersionNumber>$([System.Text.RegularExpressions.Regex]::Match($(_PatchLevelContent),
 `define\s+PY_MICRO_VERSION\s+(\d+)`).Groups[1].Value)</MicroVersionNumber>
diff --git a/PCbuild/setup.ico b/PCbuild/setup.ico
new file mode 100644
index 
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ab52102a8533bf956aadd8ae6bab13ecde1395b1
GIT binary patch

[cut]

diff --git a/PCbuild/win32/en-us/exe.msi b/PCbuild/win32/en-us/exe.msi
index 
a444b52839ec6e9ad8eadde9653e7dd370910671..83021f56d40b36fbebc3981b16204f8edca692ee
GIT binary patch

[cut]

diff --git a/pypy/tool/release/windowsinstaller/README 
b/pypy/tool/release/windowsinstaller/README
--- a/pypy/tool/release/windowsinstaller/README
+++ b/pypy/tool/release/windowsinstaller/README
@@ -9,7 +9,6 @@
     
 Steps:
     1. Translate the interpretter from the \pypy\goal folder.
-    2. Remove all __pycache__ directories (maybe do this in the script?)
-    3. Run buildrelease.bat from the visual studio command line.
+    2. Run buildrelease.bat from the top level directory.
 
-Now you should have .\PCbuild\win32\en-us\pypy-3.5.3.6609.exe
+Now you should have .\PCbuild\win32\en-us\pypy-*.exe
diff --git a/pypy/tool/release/windowsinstaller/bundle/bundle.wxs 
b/pypy/tool/release/windowsinstaller/bundle/bundle.wxs
--- a/pypy/tool/release/windowsinstaller/bundle/bundle.wxs
+++ b/pypy/tool/release/windowsinstaller/bundle/bundle.wxs
@@ -5,9 +5,9 @@
   <Bundle Name="!(loc.FullProductName)"
           UpgradeCode="$(var.CoreUpgradeCode)"
           Version="$(var.Version)"
-          IconSourceFile="..\..\..\PC\icons\setup.ico"
+          IconSourceFile="..\..\..\PCbuild\setup.ico"
           Manufacturer="!(loc.Manufacturer)"
-          AboutUrl="http://www.python.org/";
+          AboutUrl="http://www.pypy.org/";
           Compressed="no"
           
dep:ProviderKey="CPython-$(var.MajorVersionNumber).$(var.MinorVersionNumber)$(var.PyArchExt)$(var.PyTestExt)">
     <BootstrapperApplication Id="PythonBA" SourceFile="$(var.BootstrapApp)">
diff --git a/pypy/tool/release/windowsinstaller/csv_to_wxs.py 
b/pypy/tool/release/windowsinstaller/csv_to_wxs.py
--- a/pypy/tool/release/windowsinstaller/csv_to_wxs.py
+++ b/pypy/tool/release/windowsinstaller/csv_to_wxs.py
@@ -21,8 +21,44 @@
 import sys
 
 from collections import defaultdict
-from itertools import chain, zip_longest
-from pathlib import PureWindowsPath
+try:
+    from itertools import chain, zip_longest
+    from pathlib import PureWindowsPath
+except ImportError:
+    #python2
+    from itertools import chain, izip_longest as zip_longest
+    import os
+    class PureWindowsPath(object):
+        def __init__(self, path):
+            self.path = path
+        @property
+        def suffix(self):
+            return os.path.splitext(self.path)[1]
+        @property
+        def parents(self):
+            p = self.path
+            ret = [self]
+            while True:
+                p_new = os.path.dirname(p)
+                if not p_new or p_new == p:
+                    break
+                ret.append(type(self)(p_new))
+                p = p_new
+            return ret[:-1]
+        @property
+        def parent(self):
+            return type(self)(os.path.dirname(self.path))
+        @property
+        def name(self):
+            return os.path.split(self.path)[1]
+        def __str__(self):
+            return self.path
+        def __hash__(self):
+            return hash(self.path)
+        def __eq__(self, other):
+            return self.path == str(other)
+
+    from io import open
 from uuid import uuid1
 
 ID_CHAR_SUBS = {
@@ -115,14 +151,21 @@
     # that we can skip rebuilding.
     try:
         with open(install_target, 'r') as f:
-            if all(x.rstrip('\r\n') == y for x, y in zip_longest(f, lines)):
-                print('File is up to date')
+            lasti = 0
+            for i, line in enumerate(f):
+                if i >=len(lines) or line != lines[i]:
+                    break
+                lasti = i
+            else:
+                if lasti == len(lines):
+                    print('File is up to date')
                 return
     except IOError:
         pass
 
     with open(install_target, 'w') as f:
-        f.writelines(line + '\n' for line in lines)
+        f.write(u'\n'.join(lines))
+        f.write(u'\n')
     print('Wrote {} lines to {}'.format(len(lines), install_target))
 
 if __name__ == '__main__':
diff --git a/pypy/tool/release/windowsinstaller/exe/exe.wxs 
b/pypy/tool/release/windowsinstaller/exe/exe.wxs
--- a/pypy/tool/release/windowsinstaller/exe/exe.wxs
+++ b/pypy/tool/release/windowsinstaller/exe/exe.wxs
@@ -19,8 +19,8 @@
         <Feature Id="Shortcuts" AllowAdvertise="no" Title="!(loc.Title)" 
Description="!(loc.Description)">
                        <ComponentGroupRef Id="exe_pypy" />
             <Component Id="exe_shortcut" Directory="MenuDir" Guid="*">
-                <Shortcut Id="pypy3_c"
-                          Target="[#pypy3_c]"
+                <Shortcut Id="pypy_c"
+                          Target="[#pypy_c]"
                           Name="!(loc.ShortcutName)"
                           Description="!(loc.ShortcutDescription)"
                           WorkingDirectory="InstallDirectory" />
diff --git a/pypy/tool/release/windowsinstaller/exe/exe_files.wxs 
b/pypy/tool/release/windowsinstaller/exe/exe_files.wxs
--- a/pypy/tool/release/windowsinstaller/exe/exe_files.wxs
+++ b/pypy/tool/release/windowsinstaller/exe/exe_files.wxs
@@ -15,20 +15,20 @@
         <PropertyRef Id="REGISTRYKEY" />
         <ComponentGroup Id="exe_pypy">
             <Component Id="exe_pypyc" Directory="InstallDirectory" 
Guid="$(var.PythonExeComponentGuid)">
-                <File Id="pypy3_c" Name="pypy3-c.exe" 
Source="!(bindpath.goal)pypy3-c.exe" KeyPath="yes" />
+                <File Id="pypy_c" Name="pypy-c.exe" 
Source="!(bindpath.goal)pypy-c.exe" KeyPath="yes" />
                 <RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
                     <RegistryValue Key="InstallPath" Type="string" 
Value="[InstallDirectory]" KeyPath="no" />
-                    <RegistryValue Key="InstallPath" Name="ExecutablePath" 
Type="string" Value="[#pypy3_c]" KeyPath="no" />
+                    <RegistryValue Key="InstallPath" Name="ExecutablePath" 
Type="string" Value="[#pypy_c]" KeyPath="no" />
                 </RegistryKey>
             </Component>
             <Component Id="exe_pypycw" Directory="InstallDirectory" 
Guid="$(var.PythonwExeComponentGuid)">
-                <File Id="pypy3_cw" Name="pypy3-cw.exe" 
Source="!(bindpath.goal)pypy3-cw.exe" KeyPath="yes" />
+                <File Id="pypy_cw" Name="pypy-cw.exe" 
Source="!(bindpath.goal)pypy-cw.exe" KeyPath="yes" />
                 <RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
-                    <RegistryValue Key="InstallPath" 
Name="WindowedExecutablePath" Type="string" Value="[#pypy3_cw]" KeyPath="no" />
+                    <RegistryValue Key="InstallPath" 
Name="WindowedExecutablePath" Type="string" Value="[#pypy_cw]" KeyPath="no" />
                 </RegistryKey>
             </Component>
-            <Component Id="libpypy3" Directory="InstallDirectory" Guid="*">
-                <File Name="libpypy3-c.dll" 
Source="!(bindpath.goal)libpypy3-c.dll" KeyPath="yes" />
+            <Component Id="libpypy" Directory="InstallDirectory" Guid="*">
+                <File Name="libpypy-c.dll" 
Source="!(bindpath.goal)libpypy-c.dll" KeyPath="yes" />
             </Component>
         </ComponentGroup>
     </Fragment>
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to