From 6385da97839f9e5ee1b6960edab55cc82648c5ba Mon Sep 17 00:00:00 2001 From: HUMORCE Date: Sat, 18 Sep 2021 20:03:06 +0800 Subject: [PATCH] python: Full PEP514 registration (#2688) * python: Update registration * python: Update 'pre_instasll' for PEP514 * python: Update hash (install-pep-514.reg) --- bucket/python.json | 49 +++++++++++++++++++++--------- scripts/python/install-pep-514.reg | 10 +++++- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/bucket/python.json b/bucket/python.json index 4e6ce81d82..e07604501b 100644 --- a/bucket/python.json +++ b/bucket/python.json @@ -13,8 +13,24 @@ ], "hash": [ "md5:cc3eabc1f9d6c703d1d2a4e7c041bc1d", - "5d9d7a604c057e67973e1d4b3b488ae20a0e5ee5496d03b5cf091410e33e39ed", + "c2611c8010979a47cdeea1af17d5061d8df40c5356fd8c2f3ba9492d516a99d1", "d9309423b693ed63aea6b1fbfc0c34f16842cdca22a1b3edef283b87567a53b9" + ], + "pre_install": [ + "$py_root = \"$dir\".Replace('\\', '\\\\')", + "'install-pep-514.reg', 'uninstall-pep-514.reg' | ForEach-Object {", + " $py_version = ($version -split '\\.')[0..1] -join '.'", + " $content = Get-Content \"$dir\\$_\"", + " $content = $content.Replace('$py_root', $py_root)", + " $content = $content.Replace('$py_version', $py_version)", + " $content = $content.Replace('$py_fullversion', $version)", + " $content = $content.Replace('$py_cleanVersion', $version -replace '\\.')", + " $content = $content.Replace('$py_arch', \"64\")", + " if ($global) {", + " $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')", + " }", + " Set-Content \"$dir\\$_\" $content -Encoding Ascii", + "}" ] }, "32bit": { @@ -25,24 +41,27 @@ ], "hash": [ "md5:0d949bdfdbd0c8c66107a980a95efd85", - "5d9d7a604c057e67973e1d4b3b488ae20a0e5ee5496d03b5cf091410e33e39ed", + "c2611c8010979a47cdeea1af17d5061d8df40c5356fd8c2f3ba9492d516a99d1", "d9309423b693ed63aea6b1fbfc0c34f16842cdca22a1b3edef283b87567a53b9" + ], + "pre_install": [ + "$py_root = \"$dir\".Replace('\\', '\\\\')", + "'install-pep-514.reg', 'uninstall-pep-514.reg' | ForEach-Object {", + " $py_version = ($version -split '\\.')[0..1] -join '.'", + " $content = Get-Content \"$dir\\$_\"", + " $content = $content.Replace('$py_root', $py_root)", + " $content = $content.Replace('$py_version', $py_version)", + " $content = $content.Replace('$py_fullversion', $version)", + " $content = $content.Replace('$py_cleanVersion', $version -replace '\\.')", + " $content = $content.Replace('$py_arch', \"32\")", + " if ($global) {", + " $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')", + " }", + " Set-Content \"$dir\\$_\" $content -Encoding Ascii", + "}" ] } }, - "pre_install": [ - "$py_root = \"$dir\".Replace('\\', '\\\\')", - "'install-pep-514.reg', 'uninstall-pep-514.reg' | ForEach-Object {", - " $py_version = ($version -split '\\.')[0..1] -join '.'", - " $content = Get-Content \"$dir\\$_\"", - " $content = $content.Replace('$py_root', $py_root)", - " $content = $content.Replace('$py_version', $py_version)", - " if ($global) {", - " $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')", - " }", - " Set-Content \"$dir\\$_\" $content -Encoding Ascii", - "}" - ], "installer": { "script": [ "Expand-DarkArchive \"$dir\\setup.exe\" \"$dir\\_tmp\"", diff --git a/scripts/python/install-pep-514.reg b/scripts/python/install-pep-514.reg index 99cd2ba06c..4dac45bb16 100644 --- a/scripts/python/install-pep-514.reg +++ b/scripts/python/install-pep-514.reg @@ -5,7 +5,15 @@ Windows Registry Editor Version 5.00 "SupportUrl"="https://www.python.org/" [HKEY_CURRENT_USER\Software\Python\PythonCore\$py_version] -"DisplayName"="Python $py_version" +"DisplayName"="Python $py_version ($py_arch-bit)" +"SupportUrl"="https://www.python.org/" +"Version"="$py_fullversion" +"SysVersion"="$py_version" +"SysArchitecture"="$py_archbit" + +[HKEY_CURRENT_USER\Software\Python\PythonCore\$py_version\Help\Main Python Documentation] +@="$py_root\\Doc\\python$py_cleanVersion.chm" +"DisplayName"="Python $py_fullversion Documentation" [HKEY_CURRENT_USER\Software\Python\PythonCore\$py_version\InstallPath] @="$py_root"