generated from ScoopInstaller/BucketTemplate
/
python38-huawei.json
110 lines (110 loc) · 4.18 KB
/
python38-huawei.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"architecture": {
"64bit": {
"hash": "md5:62cf1a12a5276b0259e8761d4cf4fe42",
"url": "https://repo.huaweicloud.com/python/3.8.10/python-3.8.10-amd64.exe#/setup.exe"
}
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://repo.huaweicloud.com/python/$version/python-$version-amd64.exe#/setup.exe"
}
},
"hash": {
"url": "https://www.python.org/downloads/release/python-$cleanVersion/",
"regex": "$basename[\\S\\s]+?([A-Fa-f\\d]{32})"
}
},
"bin": [
[
"python.exe",
"python3"
],
[
"python.exe",
"python38"
],
"Lib\\idlelib\\idle.bat",
[
"Lib\\idlelib\\idle.bat",
"idle3"
],
[
"Lib\\idlelib\\idle.bat",
"idle38"
]
],
"checkver": {
"url": "https://www.python.org/downloads/windows/",
"regex": "python-(3\\.8\\.[\\d.]+)-"
},
"description": "A programming language that lets you work quickly and integrate systems more effectively.",
"env_add_path": [
"Scripts",
"."
],
"env_set": {
"PYTHONUTF8": "1"
},
"homepage": "https://www.python.org/",
"installer": {
"script": [
"Expand-DarkArchive \"$dir\\setup.exe\" \"$dir\\_tmp\"",
"@('path.msi', 'pip.msi') | ForEach-Object {",
" Remove-Item \"$dir\\_tmp\\AttachedContainer\\$_\"",
"}",
"(Get-ChildItem \"$dir\\_tmp\\AttachedContainer\\*.msi\").FullName | ForEach-Object {",
" # appendpath.msi does not contain any file, which causes 'msiexec /a' to fail",
" if($((Get-Item $_).Basename) -eq 'appendpath') { return }",
" Expand-MsiArchive $_ \"$dir\" ",
"}",
"Remove-Item \"$dir\\_tmp\", \"$dir\\setup.exe\" -Force -Recurse",
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext;.PY;.PYW\"",
"}"
]
},
"license": "Python-2.0",
"notes": "Allow applications and third-party installers to find python by running: \"$dir\\install-pep-514.reg\"",
"persist": [
"Scripts",
"Lib\\site-packages"
],
"post_install": [
"python -E -s -m ensurepip -U --default-pip | Out-Null",
"Write-Output \"`e[0m\" # Reset ansi to prevent color leak from installer",
"sudo regedit /s \"$dir\\install-pep-514.reg\"",
"Copy-Item \"$bucketsdir\\$bucket\\scripts\\python\\pypi-mirror.ps1\" \"$dir\\pypi-mirror.ps1\" -ErrorAction 'SilentlyContinue' -Force | Out-Null",
". \"$dir\\pypi-mirror.ps1\" -m tencent | Out-Null"
],
"pre_install": [
"$py_root = \"$dir\".Replace('\\', '\\\\')",
"$bit = '64'",
"if ($architecture -eq '32bit') { $bit = '32' }",
"'install-pep-514.reg', 'uninstall-pep-514.reg' | ForEach-Object {",
" $py_version = ($version -split '\\.')[0..1] -join '.'",
" $content = Get-Content \"$bucketsdir\\$bucket\\scripts\\python\\$_\"",
" $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', \"$bit\")",
" if ($global) {",
" $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')",
" }",
" Set-Content \"$dir\\$_\" $content -Encoding Ascii",
"}"
],
"uninstaller": {
"script": [
"if ($global) {",
" $pathext = (env 'PATHEXT' $true) -replace ';.PYW?', ''",
" env 'PATHEXT' $true \"$pathext\"",
"}",
"sudo regedit /s \"$dir\\uninstall-pep-514.reg\""
]
},
"version": "3.8.10"
}