Преглед изворни кода

Make the Windows installer work with any version of Python
(fixes bug in 1.8.0 where it no longer reads/writes the correct registry key)

rdb пре 13 година
родитељ
комит
b2f912c468
2 измењених фајлова са 6 додато и 6 уклоњено
  1. 5 6
      direct/src/directscripts/packpanda.nsi
  2. 1 0
      makepanda/makepanda.py

+ 5 - 6
direct/src/directscripts/packpanda.nsi

@@ -18,6 +18,7 @@
 ;   UBITMAP       - name of uninstaller bitmap                  (ie, "C:\Airblade\Airblade.bmp")
 ;   UBITMAP       - name of uninstaller bitmap                  (ie, "C:\Airblade\Airblade.bmp")
 ;
 ;
 ;   PANDA         - location of panda install tree.
 ;   PANDA         - location of panda install tree.
+;   PYVER         - version of Python that Panda was built with (ie, "2.7")
 ;   PANDACONF     - name of panda config directory - usually $PANDA\etc 
 ;   PANDACONF     - name of panda config directory - usually $PANDA\etc 
 ;   PSOURCE       - location of the panda source-tree if available, OR location of panda install tree.
 ;   PSOURCE       - location of the panda source-tree if available, OR location of panda install tree.
 ;   PYEXTRAS      - directory containing python extras, if any.
 ;   PYEXTRAS      - directory containing python extras, if any.
@@ -251,7 +252,7 @@ Section -post
         Push "$INSTDIR\bin"
         Push "$INSTDIR\bin"
         Call AddToPath
         Call AddToPath
 
 
-        ReadRegStr $0 HKLM "Software\Python\PythonCore\2.6\InstallPath" ""
+        ReadRegStr $0 HKLM "Software\Python\PythonCore\$PYVER\InstallPath" ""
         StrCmp $0 "$INSTDIR\python" RegPath 0
         StrCmp $0 "$INSTDIR\python" RegPath 0
         StrCmp $0 "" RegPath 0
         StrCmp $0 "" RegPath 0
 
 
@@ -261,9 +262,7 @@ Section -post
 
 
         RegPath:
         RegPath:
         DetailPrint "Adding registry keys for python..."
         DetailPrint "Adding registry keys for python..."
-        WriteRegStr HKLM "Software\Python\PythonCore\2.6\InstallPath" "" "$INSTDIR\python"
-        WriteRegStr HKLM "Software\Python\PythonCore\2.6\Help" "" ""
-        WriteRegStr HKLM "Software\Python\PythonCore\2.6\Help\Main Python Documentation" "" "$INSTDIR\python\Doc\Python25.chm"
+        WriteRegStr HKLM "Software\Python\PythonCore\$PYVER\InstallPath" "" "$INSTDIR\python"
         SkipRegPath:
         SkipRegPath:
         !endif
         !endif
 
 
@@ -289,9 +288,9 @@ Section Uninstall
         Push "$INSTDIR\bin"
         Push "$INSTDIR\bin"
         Call un.RemoveFromPath
         Call un.RemoveFromPath
 
 
-        ReadRegStr $0 HKLM "Software\Python\PythonCore\2.6\InstallPath" ""
+        ReadRegStr $0 HKLM "Software\Python\PythonCore\$PYVER\InstallPath" ""
         StrCmp $0 "$INSTDIR\python" 0 SkipUnReg
         StrCmp $0 "$INSTDIR\python" 0 SkipUnReg
-        DeleteRegKey HKLM "Software\Python\PythonCore\2.6"
+        DeleteRegKey HKLM "Software\Python\PythonCore\$PYVER"
         SkipUnReg:
         SkipUnReg:
         !endif
         !endif
 
 

+ 1 - 0
makepanda/makepanda.py

@@ -5613,6 +5613,7 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
     cmd=cmd+'/DIBITMAP="panda-install.bmp" '
     cmd=cmd+'/DIBITMAP="panda-install.bmp" '
     cmd=cmd+'/DUBITMAP="panda-install.bmp" '
     cmd=cmd+'/DUBITMAP="panda-install.bmp" '
     cmd=cmd+'/DPANDA="'+panda+'" '
     cmd=cmd+'/DPANDA="'+panda+'" '
+    cmd=cmd+'/DPYVER="'+SDK["PYTHONVERSION"][6:9]+'" '
     cmd=cmd+'/DPANDACONF="'+panda+'\\etc" '
     cmd=cmd+'/DPANDACONF="'+panda+'\\etc" '
     cmd=cmd+'/DPSOURCE="'+psource+'" '
     cmd=cmd+'/DPSOURCE="'+psource+'" '
     cmd=cmd+'/DPYEXTRAS="'+os.path.abspath(GetThirdpartyBase())+'\\win-extras" '
     cmd=cmd+'/DPYEXTRAS="'+os.path.abspath(GetThirdpartyBase())+'\\win-extras" '