Show More
@@ -1,215 +1,217 b'' | |||||
1 | # install-dependencies.ps1 - Install Windows dependencies for building Mercurial |
|
1 | # install-dependencies.ps1 - Install Windows dependencies for building Mercurial | |
2 | # |
|
2 | # | |
3 | # Copyright 2019 Gregory Szorc <gregory.szorc@gmail.com> |
|
3 | # Copyright 2019 Gregory Szorc <gregory.szorc@gmail.com> | |
4 | # |
|
4 | # | |
5 | # This software may be used and distributed according to the terms of the |
|
5 | # This software may be used and distributed according to the terms of the | |
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 |
|
7 | |||
8 | # This script can be used to bootstrap a Mercurial build environment on |
|
8 | # This script can be used to bootstrap a Mercurial build environment on | |
9 | # Windows. |
|
9 | # Windows. | |
10 | # |
|
10 | # | |
11 | # The script makes a lot of assumptions about how things should work. |
|
11 | # The script makes a lot of assumptions about how things should work. | |
12 | # For example, the install location of Python is hardcoded to c:\hgdev\*. |
|
12 | # For example, the install location of Python is hardcoded to c:\hgdev\*. | |
13 | # |
|
13 | # | |
14 | # The script should be executed from a PowerShell with elevated privileges |
|
14 | # The script should be executed from a PowerShell with elevated privileges | |
15 | # if you don't want to see a UAC prompt for various installers. |
|
15 | # if you don't want to see a UAC prompt for various installers. | |
16 | # |
|
16 | # | |
17 | # The script is tested on Windows 10 and Windows Server 2019 (in EC2). |
|
17 | # The script is tested on Windows 10 and Windows Server 2019 (in EC2). | |
18 |
|
18 | |||
19 | $VS_BUILD_TOOLS_URL = "https://download.visualstudio.microsoft.com/download/pr/a1603c02-8a66-4b83-b821-811e3610a7c4/aa2db8bb39e0cbd23e9940d8951e0bc3/vs_buildtools.exe" |
|
19 | $VS_BUILD_TOOLS_URL = "https://download.visualstudio.microsoft.com/download/pr/a1603c02-8a66-4b83-b821-811e3610a7c4/aa2db8bb39e0cbd23e9940d8951e0bc3/vs_buildtools.exe" | |
20 | $VS_BUILD_TOOLS_SHA256 = "911E292B8E6E5F46CBC17003BDCD2D27A70E616E8D5E6E69D5D489A605CAA139" |
|
20 | $VS_BUILD_TOOLS_SHA256 = "911E292B8E6E5F46CBC17003BDCD2D27A70E616E8D5E6E69D5D489A605CAA139" | |
21 |
|
21 | |||
22 | $VC9_PYTHON_URL = "https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi" |
|
22 | $VC9_PYTHON_URL = "https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi" | |
23 | $VC9_PYTHON_SHA256 = "070474db76a2e625513a5835df4595df9324d820f9cc97eab2a596dcbc2f5cbf" |
|
23 | $VC9_PYTHON_SHA256 = "070474db76a2e625513a5835df4595df9324d820f9cc97eab2a596dcbc2f5cbf" | |
24 |
|
24 | |||
25 | $PYTHON27_x64_URL = "https://www.python.org/ftp/python/2.7.18/python-2.7.18.amd64.msi" |
|
25 | $PYTHON27_x64_URL = "https://www.python.org/ftp/python/2.7.18/python-2.7.18.amd64.msi" | |
26 | $PYTHON27_x64_SHA256 = "b74a3afa1e0bf2a6fc566a7b70d15c9bfabba3756fb077797d16fffa27800c05" |
|
26 | $PYTHON27_x64_SHA256 = "b74a3afa1e0bf2a6fc566a7b70d15c9bfabba3756fb077797d16fffa27800c05" | |
27 | $PYTHON27_X86_URL = "https://www.python.org/ftp/python/2.7.18/python-2.7.18.msi" |
|
27 | $PYTHON27_X86_URL = "https://www.python.org/ftp/python/2.7.18/python-2.7.18.msi" | |
28 | $PYTHON27_X86_SHA256 = "d901802e90026e9bad76b8a81f8dd7e43c7d7e8269d9281c9e9df7a9c40480a9" |
|
28 | $PYTHON27_X86_SHA256 = "d901802e90026e9bad76b8a81f8dd7e43c7d7e8269d9281c9e9df7a9c40480a9" | |
29 |
|
29 | |||
30 | $PYTHON37_x86_URL = "https://www.python.org/ftp/python/3.7.9/python-3.7.9.exe" |
|
30 | $PYTHON37_x86_URL = "https://www.python.org/ftp/python/3.7.9/python-3.7.9.exe" | |
31 | $PYTHON37_x86_SHA256 = "769bb7c74ad1df6d7d74071cc16a984ff6182e4016e11b8949b93db487977220" |
|
31 | $PYTHON37_x86_SHA256 = "769bb7c74ad1df6d7d74071cc16a984ff6182e4016e11b8949b93db487977220" | |
32 | $PYTHON37_X64_URL = "https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe" |
|
32 | $PYTHON37_X64_URL = "https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe" | |
33 | $PYTHON37_x64_SHA256 = "e69ed52afb5a722e5c56f6c21d594e85c17cb29f12f18bb69751cf1714e0f987" |
|
33 | $PYTHON37_x64_SHA256 = "e69ed52afb5a722e5c56f6c21d594e85c17cb29f12f18bb69751cf1714e0f987" | |
34 |
|
34 | |||
35 | $PYTHON38_x86_URL = "https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe" |
|
35 | $PYTHON38_x86_URL = "https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe" | |
36 | $PYTHON38_x86_SHA256 = "ad07633a1f0cd795f3bf9da33729f662281df196b4567fa795829f3bb38a30ac" |
|
36 | $PYTHON38_x86_SHA256 = "ad07633a1f0cd795f3bf9da33729f662281df196b4567fa795829f3bb38a30ac" | |
37 | $PYTHON38_x64_URL = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe" |
|
37 | $PYTHON38_x64_URL = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe" | |
38 | $PYTHON38_x64_SHA256 = "7628244cb53408b50639d2c1287c659f4e29d3dfdb9084b11aed5870c0c6a48a" |
|
38 | $PYTHON38_x64_SHA256 = "7628244cb53408b50639d2c1287c659f4e29d3dfdb9084b11aed5870c0c6a48a" | |
39 |
|
39 | |||
40 | $PYTHON39_x86_URL = "https://www.python.org/ftp/python/3.9.5/python-3.9.5.exe" |
|
40 | $PYTHON39_x86_URL = "https://www.python.org/ftp/python/3.9.5/python-3.9.5.exe" | |
41 | $PYTHON39_x86_SHA256 = "505129081a839b699a6ab9064b441ad922ef03767b5dd4241fd0c2166baf64de" |
|
41 | $PYTHON39_x86_SHA256 = "505129081a839b699a6ab9064b441ad922ef03767b5dd4241fd0c2166baf64de" | |
42 | $PYTHON39_x64_URL = "https://www.python.org/ftp/python/3.9.5/python-3.9.5-amd64.exe" |
|
42 | $PYTHON39_x64_URL = "https://www.python.org/ftp/python/3.9.5/python-3.9.5-amd64.exe" | |
43 | $PYTHON39_x64_SHA256 = "84d5243088ba00c11e51905c704dbe041040dfff044f4e1ce5476844ee2e6eac" |
|
43 | $PYTHON39_x64_SHA256 = "84d5243088ba00c11e51905c704dbe041040dfff044f4e1ce5476844ee2e6eac" | |
44 |
|
44 | |||
45 | # PIP 19.2.3. |
|
45 | # PIP 19.2.3. | |
46 | $PIP_URL = "https://github.com/pypa/get-pip/raw/309a56c5fd94bd1134053a541cb4657a4e47e09d/get-pip.py" |
|
46 | $PIP_URL = "https://github.com/pypa/get-pip/raw/309a56c5fd94bd1134053a541cb4657a4e47e09d/get-pip.py" | |
47 | $PIP_SHA256 = "57e3643ff19f018f8a00dfaa6b7e4620e3c1a7a2171fd218425366ec006b3bfe" |
|
47 | $PIP_SHA256 = "57e3643ff19f018f8a00dfaa6b7e4620e3c1a7a2171fd218425366ec006b3bfe" | |
48 |
|
48 | |||
49 | $VIRTUALENV_URL = "https://files.pythonhosted.org/packages/66/f0/6867af06d2e2f511e4e1d7094ff663acdebc4f15d4a0cb0fed1007395124/virtualenv-16.7.5.tar.gz" |
|
49 | $VIRTUALENV_URL = "https://files.pythonhosted.org/packages/66/f0/6867af06d2e2f511e4e1d7094ff663acdebc4f15d4a0cb0fed1007395124/virtualenv-16.7.5.tar.gz" | |
50 | $VIRTUALENV_SHA256 = "f78d81b62d3147396ac33fc9d77579ddc42cc2a98dd9ea38886f616b33bc7fb2" |
|
50 | $VIRTUALENV_SHA256 = "f78d81b62d3147396ac33fc9d77579ddc42cc2a98dd9ea38886f616b33bc7fb2" | |
51 |
|
51 | |||
52 | $INNO_SETUP_URL = "http://files.jrsoftware.org/is/5/innosetup-5.6.1-unicode.exe" |
|
52 | $INNO_SETUP_URL = "http://files.jrsoftware.org/is/5/innosetup-5.6.1-unicode.exe" | |
53 | $INNO_SETUP_SHA256 = "27D49E9BC769E9D1B214C153011978DB90DC01C2ACD1DDCD9ED7B3FE3B96B538" |
|
53 | $INNO_SETUP_SHA256 = "27D49E9BC769E9D1B214C153011978DB90DC01C2ACD1DDCD9ED7B3FE3B96B538" | |
54 |
|
54 | |||
55 | $MINGW_BIN_URL = "https://osdn.net/frs/redir.php?m=constant&f=mingw%2F68260%2Fmingw-get-0.6.3-mingw32-pre-20170905-1-bin.zip" |
|
55 | $MINGW_BIN_URL = "https://osdn.net/frs/redir.php?m=constant&f=mingw%2F68260%2Fmingw-get-0.6.3-mingw32-pre-20170905-1-bin.zip" | |
56 | $MINGW_BIN_SHA256 = "2AB8EFD7C7D1FC8EAF8B2FA4DA4EEF8F3E47768284C021599BC7435839A046DF" |
|
56 | $MINGW_BIN_SHA256 = "2AB8EFD7C7D1FC8EAF8B2FA4DA4EEF8F3E47768284C021599BC7435839A046DF" | |
57 |
|
57 | |||
58 | $MERCURIAL_WHEEL_FILENAME = "mercurial-5.1.2-cp27-cp27m-win_amd64.whl" |
|
58 | $MERCURIAL_WHEEL_FILENAME = "mercurial-5.1.2-cp27-cp27m-win_amd64.whl" | |
59 | $MERCURIAL_WHEEL_URL = "https://files.pythonhosted.org/packages/6d/47/e031e47f7fe9b16e4e3383da47e2b0a7eae6e603996bc67a03ec4fa1b3f4/$MERCURIAL_WHEEL_FILENAME" |
|
59 | $MERCURIAL_WHEEL_URL = "https://files.pythonhosted.org/packages/6d/47/e031e47f7fe9b16e4e3383da47e2b0a7eae6e603996bc67a03ec4fa1b3f4/$MERCURIAL_WHEEL_FILENAME" | |
60 | $MERCURIAL_WHEEL_SHA256 = "1d18c7f6ca1456f0f62ee65c9a50c14cbba48ce6e924930cdb10537f5c9eaf5f" |
|
60 | $MERCURIAL_WHEEL_SHA256 = "1d18c7f6ca1456f0f62ee65c9a50c14cbba48ce6e924930cdb10537f5c9eaf5f" | |
61 |
|
61 | |||
62 | $RUSTUP_INIT_URL = "https://static.rust-lang.org/rustup/archive/1.21.1/x86_64-pc-windows-gnu/rustup-init.exe" |
|
62 | $RUSTUP_INIT_URL = "https://static.rust-lang.org/rustup/archive/1.21.1/x86_64-pc-windows-gnu/rustup-init.exe" | |
63 | $RUSTUP_INIT_SHA256 = "d17df34ba974b9b19cf5c75883a95475aa22ddc364591d75d174090d55711c72" |
|
63 | $RUSTUP_INIT_SHA256 = "d17df34ba974b9b19cf5c75883a95475aa22ddc364591d75d174090d55711c72" | |
64 |
|
64 | |||
65 | $PYOXIDIZER_URL = "https://github.com/indygreg/PyOxidizer/releases/download/pyoxidizer%2F0.16.0/PyOxidizer-0.16.0-x64.msi" |
|
65 | $PYOXIDIZER_URL = "https://github.com/indygreg/PyOxidizer/releases/download/pyoxidizer%2F0.16.0/PyOxidizer-0.16.0-x64.msi" | |
66 | $PYOXIDIZER_SHA256 = "2a9c58add9161c272c418d5e6dec13fbe648f624b5d26770190357e4d664f24e" |
|
66 | $PYOXIDIZER_SHA256 = "2a9c58add9161c272c418d5e6dec13fbe648f624b5d26770190357e4d664f24e" | |
67 |
|
67 | |||
68 | # Writing progress slows down downloads substantially. So disable it. |
|
68 | # Writing progress slows down downloads substantially. So disable it. | |
69 | $progressPreference = 'silentlyContinue' |
|
69 | $progressPreference = 'silentlyContinue' | |
70 |
|
70 | |||
71 | function Secure-Download($url, $path, $sha256) { |
|
71 | function Secure-Download($url, $path, $sha256) { | |
72 | if (Test-Path -Path $path) { |
|
72 | if (Test-Path -Path $path) { | |
73 | Get-FileHash -Path $path -Algorithm SHA256 -OutVariable hash |
|
73 | Get-FileHash -Path $path -Algorithm SHA256 -OutVariable hash | |
74 |
|
74 | |||
75 | if ($hash.Hash -eq $sha256) { |
|
75 | if ($hash.Hash -eq $sha256) { | |
76 | Write-Output "SHA256 of $path verified as $sha256" |
|
76 | Write-Output "SHA256 of $path verified as $sha256" | |
77 | return |
|
77 | return | |
78 | } |
|
78 | } | |
79 |
|
79 | |||
80 | Write-Output "hash mismatch on $path; downloading again" |
|
80 | Write-Output "hash mismatch on $path; downloading again" | |
81 | } |
|
81 | } | |
82 |
|
82 | |||
83 | Write-Output "downloading $url to $path" |
|
83 | Write-Output "downloading $url to $path" | |
84 | Invoke-WebRequest -Uri $url -OutFile $path |
|
84 | Invoke-WebRequest -Uri $url -OutFile $path | |
85 | Get-FileHash -Path $path -Algorithm SHA256 -OutVariable hash |
|
85 | Get-FileHash -Path $path -Algorithm SHA256 -OutVariable hash | |
86 |
|
86 | |||
87 | if ($hash.Hash -ne $sha256) { |
|
87 | if ($hash.Hash -ne $sha256) { | |
88 | Remove-Item -Path $path |
|
88 | Remove-Item -Path $path | |
89 | throw "hash mismatch when downloading $url; got $($hash.Hash), expected $sha256" |
|
89 | throw "hash mismatch when downloading $url; got $($hash.Hash), expected $sha256" | |
90 | } |
|
90 | } | |
91 | } |
|
91 | } | |
92 |
|
92 | |||
93 | function Invoke-Process($path, $arguments) { |
|
93 | function Invoke-Process($path, $arguments) { | |
|
94 | echo "$path $arguments" | |||
|
95 | ||||
94 | $p = Start-Process -FilePath $path -ArgumentList $arguments -Wait -PassThru -WindowStyle Hidden |
|
96 | $p = Start-Process -FilePath $path -ArgumentList $arguments -Wait -PassThru -WindowStyle Hidden | |
95 |
|
97 | |||
96 | if ($p.ExitCode -ne 0) { |
|
98 | if ($p.ExitCode -ne 0) { | |
97 | throw "process exited non-0: $($p.ExitCode)" |
|
99 | throw "process exited non-0: $($p.ExitCode)" | |
98 | } |
|
100 | } | |
99 | } |
|
101 | } | |
100 |
|
102 | |||
101 | function Install-Python3($name, $installer, $dest, $pip) { |
|
103 | function Install-Python3($name, $installer, $dest, $pip) { | |
102 | Write-Output "installing $name" |
|
104 | Write-Output "installing $name" | |
103 |
|
105 | |||
104 | # We hit this when running the script as part of Simple Systems Manager in |
|
106 | # We hit this when running the script as part of Simple Systems Manager in | |
105 | # EC2. The Python 3 installer doesn't seem to like per-user installs |
|
107 | # EC2. The Python 3 installer doesn't seem to like per-user installs | |
106 | # when running as the SYSTEM user. So enable global installs if executed in |
|
108 | # when running as the SYSTEM user. So enable global installs if executed in | |
107 | # this mode. |
|
109 | # this mode. | |
108 | if ($env:USERPROFILE -eq "C:\Windows\system32\config\systemprofile") { |
|
110 | if ($env:USERPROFILE -eq "C:\Windows\system32\config\systemprofile") { | |
109 | Write-Output "running with SYSTEM account; installing for all users" |
|
111 | Write-Output "running with SYSTEM account; installing for all users" | |
110 | $allusers = "1" |
|
112 | $allusers = "1" | |
111 | } |
|
113 | } | |
112 | else { |
|
114 | else { | |
113 | $allusers = "0" |
|
115 | $allusers = "0" | |
114 | } |
|
116 | } | |
115 |
|
117 | |||
116 | Invoke-Process $installer "/quiet TargetDir=${dest} InstallAllUsers=${allusers} AssociateFiles=0 CompileAll=0 PrependPath=0 Include_doc=0 Include_launcher=0 InstallLauncherAllUsers=0 Include_pip=0 Include_test=0" |
|
118 | Invoke-Process $installer "/quiet TargetDir=${dest} InstallAllUsers=${allusers} AssociateFiles=0 CompileAll=0 PrependPath=0 Include_doc=0 Include_launcher=0 InstallLauncherAllUsers=0 Include_pip=0 Include_test=0" | |
117 | Invoke-Process ${dest}\python.exe $pip |
|
119 | Invoke-Process ${dest}\python.exe $pip | |
118 | } |
|
120 | } | |
119 |
|
121 | |||
120 | function Install-Rust($prefix) { |
|
122 | function Install-Rust($prefix) { | |
121 | Write-Output "installing Rust" |
|
123 | Write-Output "installing Rust" | |
122 | $Env:RUSTUP_HOME = "${prefix}\rustup" |
|
124 | $Env:RUSTUP_HOME = "${prefix}\rustup" | |
123 | $Env:CARGO_HOME = "${prefix}\cargo" |
|
125 | $Env:CARGO_HOME = "${prefix}\cargo" | |
124 |
|
126 | |||
125 | Invoke-Process "${prefix}\assets\rustup-init.exe" "-y --default-host x86_64-pc-windows-msvc" |
|
127 | Invoke-Process "${prefix}\assets\rustup-init.exe" "-y --default-host x86_64-pc-windows-msvc" | |
126 | Invoke-Process "${prefix}\cargo\bin\rustup.exe" "target add i686-pc-windows-msvc" |
|
128 | Invoke-Process "${prefix}\cargo\bin\rustup.exe" "target add i686-pc-windows-msvc" | |
127 | Invoke-Process "${prefix}\cargo\bin\rustup.exe" "install 1.52.0" |
|
129 | Invoke-Process "${prefix}\cargo\bin\rustup.exe" "install 1.52.0" | |
128 | Invoke-Process "${prefix}\cargo\bin\rustup.exe" "component add clippy" |
|
130 | Invoke-Process "${prefix}\cargo\bin\rustup.exe" "component add clippy" | |
129 | } |
|
131 | } | |
130 |
|
132 | |||
131 | function Install-Dependencies($prefix) { |
|
133 | function Install-Dependencies($prefix) { | |
132 | if (!(Test-Path -Path $prefix\assets)) { |
|
134 | if (!(Test-Path -Path $prefix\assets)) { | |
133 | New-Item -Path $prefix\assets -ItemType Directory |
|
135 | New-Item -Path $prefix\assets -ItemType Directory | |
134 | } |
|
136 | } | |
135 |
|
137 | |||
136 | $pip = "${prefix}\assets\get-pip.py" |
|
138 | $pip = "${prefix}\assets\get-pip.py" | |
137 |
|
139 | |||
138 | Secure-Download $VC9_PYTHON_URL ${prefix}\assets\VCForPython27.msi $VC9_PYTHON_SHA256 |
|
140 | Secure-Download $VC9_PYTHON_URL ${prefix}\assets\VCForPython27.msi $VC9_PYTHON_SHA256 | |
139 | Secure-Download $PYTHON27_x86_URL ${prefix}\assets\python27-x86.msi $PYTHON27_x86_SHA256 |
|
141 | Secure-Download $PYTHON27_x86_URL ${prefix}\assets\python27-x86.msi $PYTHON27_x86_SHA256 | |
140 | Secure-Download $PYTHON27_x64_URL ${prefix}\assets\python27-x64.msi $PYTHON27_x64_SHA256 |
|
142 | Secure-Download $PYTHON27_x64_URL ${prefix}\assets\python27-x64.msi $PYTHON27_x64_SHA256 | |
141 | Secure-Download $PYTHON37_x86_URL ${prefix}\assets\python37-x86.exe $PYTHON37_x86_SHA256 |
|
143 | Secure-Download $PYTHON37_x86_URL ${prefix}\assets\python37-x86.exe $PYTHON37_x86_SHA256 | |
142 | Secure-Download $PYTHON37_x64_URL ${prefix}\assets\python37-x64.exe $PYTHON37_x64_SHA256 |
|
144 | Secure-Download $PYTHON37_x64_URL ${prefix}\assets\python37-x64.exe $PYTHON37_x64_SHA256 | |
143 | Secure-Download $PYTHON38_x86_URL ${prefix}\assets\python38-x86.exe $PYTHON38_x86_SHA256 |
|
145 | Secure-Download $PYTHON38_x86_URL ${prefix}\assets\python38-x86.exe $PYTHON38_x86_SHA256 | |
144 | Secure-Download $PYTHON38_x64_URL ${prefix}\assets\python38-x64.exe $PYTHON38_x64_SHA256 |
|
146 | Secure-Download $PYTHON38_x64_URL ${prefix}\assets\python38-x64.exe $PYTHON38_x64_SHA256 | |
145 | Secure-Download $PYTHON39_x86_URL ${prefix}\assets\python39-x86.exe $PYTHON39_x86_SHA256 |
|
147 | Secure-Download $PYTHON39_x86_URL ${prefix}\assets\python39-x86.exe $PYTHON39_x86_SHA256 | |
146 | Secure-Download $PYTHON39_x64_URL ${prefix}\assets\python39-x64.exe $PYTHON39_x64_SHA256 |
|
148 | Secure-Download $PYTHON39_x64_URL ${prefix}\assets\python39-x64.exe $PYTHON39_x64_SHA256 | |
147 | Secure-Download $PIP_URL ${pip} $PIP_SHA256 |
|
149 | Secure-Download $PIP_URL ${pip} $PIP_SHA256 | |
148 | Secure-Download $VIRTUALENV_URL ${prefix}\assets\virtualenv.tar.gz $VIRTUALENV_SHA256 |
|
150 | Secure-Download $VIRTUALENV_URL ${prefix}\assets\virtualenv.tar.gz $VIRTUALENV_SHA256 | |
149 | Secure-Download $VS_BUILD_TOOLS_URL ${prefix}\assets\vs_buildtools.exe $VS_BUILD_TOOLS_SHA256 |
|
151 | Secure-Download $VS_BUILD_TOOLS_URL ${prefix}\assets\vs_buildtools.exe $VS_BUILD_TOOLS_SHA256 | |
150 | Secure-Download $INNO_SETUP_URL ${prefix}\assets\InnoSetup.exe $INNO_SETUP_SHA256 |
|
152 | Secure-Download $INNO_SETUP_URL ${prefix}\assets\InnoSetup.exe $INNO_SETUP_SHA256 | |
151 | Secure-Download $MINGW_BIN_URL ${prefix}\assets\mingw-get-bin.zip $MINGW_BIN_SHA256 |
|
153 | Secure-Download $MINGW_BIN_URL ${prefix}\assets\mingw-get-bin.zip $MINGW_BIN_SHA256 | |
152 | Secure-Download $MERCURIAL_WHEEL_URL ${prefix}\assets\${MERCURIAL_WHEEL_FILENAME} $MERCURIAL_WHEEL_SHA256 |
|
154 | Secure-Download $MERCURIAL_WHEEL_URL ${prefix}\assets\${MERCURIAL_WHEEL_FILENAME} $MERCURIAL_WHEEL_SHA256 | |
153 | Secure-Download $RUSTUP_INIT_URL ${prefix}\assets\rustup-init.exe $RUSTUP_INIT_SHA256 |
|
155 | Secure-Download $RUSTUP_INIT_URL ${prefix}\assets\rustup-init.exe $RUSTUP_INIT_SHA256 | |
154 | Secure-Download $PYOXIDIZER_URL ${prefix}\assets\PyOxidizer.msi $PYOXIDIZER_SHA256 |
|
156 | Secure-Download $PYOXIDIZER_URL ${prefix}\assets\PyOxidizer.msi $PYOXIDIZER_SHA256 | |
155 |
|
157 | |||
156 | Write-Output "installing Python 2.7 32-bit" |
|
158 | Write-Output "installing Python 2.7 32-bit" | |
157 | Invoke-Process msiexec.exe "/i ${prefix}\assets\python27-x86.msi /l* ${prefix}\assets\python27-x86.log /q TARGETDIR=${prefix}\python27-x86 ALLUSERS=" |
|
159 | Invoke-Process msiexec.exe "/i ${prefix}\assets\python27-x86.msi /l* ${prefix}\assets\python27-x86.log /q TARGETDIR=${prefix}\python27-x86 ALLUSERS=" | |
158 | Invoke-Process ${prefix}\python27-x86\python.exe ${prefix}\assets\get-pip.py |
|
160 | Invoke-Process ${prefix}\python27-x86\python.exe ${prefix}\assets\get-pip.py | |
159 | Invoke-Process ${prefix}\python27-x86\Scripts\pip.exe "install ${prefix}\assets\virtualenv.tar.gz" |
|
161 | Invoke-Process ${prefix}\python27-x86\Scripts\pip.exe "install ${prefix}\assets\virtualenv.tar.gz" | |
160 |
|
162 | |||
161 | Write-Output "installing Python 2.7 64-bit" |
|
163 | Write-Output "installing Python 2.7 64-bit" | |
162 | Invoke-Process msiexec.exe "/i ${prefix}\assets\python27-x64.msi /l* ${prefix}\assets\python27-x64.log /q TARGETDIR=${prefix}\python27-x64 ALLUSERS=" |
|
164 | Invoke-Process msiexec.exe "/i ${prefix}\assets\python27-x64.msi /l* ${prefix}\assets\python27-x64.log /q TARGETDIR=${prefix}\python27-x64 ALLUSERS=" | |
163 | Invoke-Process ${prefix}\python27-x64\python.exe ${prefix}\assets\get-pip.py |
|
165 | Invoke-Process ${prefix}\python27-x64\python.exe ${prefix}\assets\get-pip.py | |
164 | Invoke-Process ${prefix}\python27-x64\Scripts\pip.exe "install ${prefix}\assets\virtualenv.tar.gz" |
|
166 | Invoke-Process ${prefix}\python27-x64\Scripts\pip.exe "install ${prefix}\assets\virtualenv.tar.gz" | |
165 |
|
167 | |||
166 | Install-Python3 "Python 3.7 32-bit" ${prefix}\assets\python37-x86.exe ${prefix}\python37-x86 ${pip} |
|
168 | Install-Python3 "Python 3.7 32-bit" ${prefix}\assets\python37-x86.exe ${prefix}\python37-x86 ${pip} | |
167 | Install-Python3 "Python 3.7 64-bit" ${prefix}\assets\python37-x64.exe ${prefix}\python37-x64 ${pip} |
|
169 | Install-Python3 "Python 3.7 64-bit" ${prefix}\assets\python37-x64.exe ${prefix}\python37-x64 ${pip} | |
168 | Install-Python3 "Python 3.8 32-bit" ${prefix}\assets\python38-x86.exe ${prefix}\python38-x86 ${pip} |
|
170 | Install-Python3 "Python 3.8 32-bit" ${prefix}\assets\python38-x86.exe ${prefix}\python38-x86 ${pip} | |
169 | Install-Python3 "Python 3.8 64-bit" ${prefix}\assets\python38-x64.exe ${prefix}\python38-x64 ${pip} |
|
171 | Install-Python3 "Python 3.8 64-bit" ${prefix}\assets\python38-x64.exe ${prefix}\python38-x64 ${pip} | |
170 | Install-Python3 "Python 3.9 32-bit" ${prefix}\assets\python39-x86.exe ${prefix}\python39-x86 ${pip} |
|
172 | Install-Python3 "Python 3.9 32-bit" ${prefix}\assets\python39-x86.exe ${prefix}\python39-x86 ${pip} | |
171 | Install-Python3 "Python 3.9 64-bit" ${prefix}\assets\python39-x64.exe ${prefix}\python39-x64 ${pip} |
|
173 | Install-Python3 "Python 3.9 64-bit" ${prefix}\assets\python39-x64.exe ${prefix}\python39-x64 ${pip} | |
172 |
|
174 | |||
173 | Write-Output "installing Visual Studio 2017 Build Tools and SDKs" |
|
175 | Write-Output "installing Visual Studio 2017 Build Tools and SDKs" | |
174 | Invoke-Process ${prefix}\assets\vs_buildtools.exe "--quiet --wait --norestart --nocache --channelUri https://aka.ms/vs/15/release/channel --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.VC.140" |
|
176 | Invoke-Process ${prefix}\assets\vs_buildtools.exe "--quiet --wait --norestart --nocache --channelUri https://aka.ms/vs/15/release/channel --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.VC.140" | |
175 |
|
177 | |||
176 | Write-Output "installing PyOxidizer" |
|
178 | Write-Output "installing PyOxidizer" | |
177 | Invoke-Process msiexec.exe "/i ${prefix}\assets\PyOxidizer.msi /l* ${prefix}\assets\PyOxidizer.log /quiet" |
|
179 | Invoke-Process msiexec.exe "/i ${prefix}\assets\PyOxidizer.msi /l* ${prefix}\assets\PyOxidizer.log /quiet" | |
178 |
|
180 | |||
179 | Install-Rust ${prefix} |
|
181 | Install-Rust ${prefix} | |
180 |
|
182 | |||
181 | Write-Output "installing Visual C++ 9.0 for Python 2.7" |
|
183 | Write-Output "installing Visual C++ 9.0 for Python 2.7" | |
182 | Invoke-Process msiexec.exe "/i ${prefix}\assets\VCForPython27.msi /l* ${prefix}\assets\VCForPython27.log /q" |
|
184 | Invoke-Process msiexec.exe "/i ${prefix}\assets\VCForPython27.msi /l* ${prefix}\assets\VCForPython27.log /q" | |
183 |
|
185 | |||
184 | Write-Output "installing Inno Setup" |
|
186 | Write-Output "installing Inno Setup" | |
185 | Invoke-Process ${prefix}\assets\InnoSetup.exe "/SP- /VERYSILENT /SUPPRESSMSGBOXES" |
|
187 | Invoke-Process ${prefix}\assets\InnoSetup.exe "/SP- /VERYSILENT /SUPPRESSMSGBOXES" | |
186 |
|
188 | |||
187 | Write-Output "extracting MinGW base archive" |
|
189 | Write-Output "extracting MinGW base archive" | |
188 | Expand-Archive -Path ${prefix}\assets\mingw-get-bin.zip -DestinationPath "${prefix}\MinGW" -Force |
|
190 | Expand-Archive -Path ${prefix}\assets\mingw-get-bin.zip -DestinationPath "${prefix}\MinGW" -Force | |
189 |
|
191 | |||
190 | Write-Output "updating MinGW package catalogs" |
|
192 | Write-Output "updating MinGW package catalogs" | |
191 | Invoke-Process ${prefix}\MinGW\bin\mingw-get.exe "update" |
|
193 | Invoke-Process ${prefix}\MinGW\bin\mingw-get.exe "update" | |
192 |
|
194 | |||
193 | Write-Output "installing MinGW packages" |
|
195 | Write-Output "installing MinGW packages" | |
194 | Invoke-Process ${prefix}\MinGW\bin\mingw-get.exe "install msys-base msys-coreutils msys-diffutils msys-unzip" |
|
196 | Invoke-Process ${prefix}\MinGW\bin\mingw-get.exe "install msys-base msys-coreutils msys-diffutils msys-unzip" | |
195 |
|
197 | |||
196 | # Construct a virtualenv useful for bootstrapping. It conveniently contains a |
|
198 | # Construct a virtualenv useful for bootstrapping. It conveniently contains a | |
197 | # Mercurial install. |
|
199 | # Mercurial install. | |
198 | Write-Output "creating bootstrap virtualenv with Mercurial" |
|
200 | Write-Output "creating bootstrap virtualenv with Mercurial" | |
199 | Invoke-Process "$prefix\python27-x64\Scripts\virtualenv.exe" "${prefix}\venv-bootstrap" |
|
201 | Invoke-Process "$prefix\python27-x64\Scripts\virtualenv.exe" "${prefix}\venv-bootstrap" | |
200 | Invoke-Process "${prefix}\venv-bootstrap\Scripts\pip.exe" "install ${prefix}\assets\${MERCURIAL_WHEEL_FILENAME}" |
|
202 | Invoke-Process "${prefix}\venv-bootstrap\Scripts\pip.exe" "install ${prefix}\assets\${MERCURIAL_WHEEL_FILENAME}" | |
201 | } |
|
203 | } | |
202 |
|
204 | |||
203 | function Clone-Mercurial-Repo($prefix, $repo_url, $dest) { |
|
205 | function Clone-Mercurial-Repo($prefix, $repo_url, $dest) { | |
204 | Write-Output "cloning $repo_url to $dest" |
|
206 | Write-Output "cloning $repo_url to $dest" | |
205 | # TODO Figure out why CA verification isn't working in EC2 and remove |
|
207 | # TODO Figure out why CA verification isn't working in EC2 and remove | |
206 | # --insecure. |
|
208 | # --insecure. | |
207 | Invoke-Process "${prefix}\venv-bootstrap\Scripts\hg.exe" "clone --insecure $repo_url $dest" |
|
209 | Invoke-Process "${prefix}\venv-bootstrap\Scripts\hg.exe" "clone --insecure $repo_url $dest" | |
208 |
|
210 | |||
209 | # Mark repo as non-publishing by default for convenience. |
|
211 | # Mark repo as non-publishing by default for convenience. | |
210 | Add-Content -Path "$dest\.hg\hgrc" -Value "`n[phases]`npublish = false" |
|
212 | Add-Content -Path "$dest\.hg\hgrc" -Value "`n[phases]`npublish = false" | |
211 | } |
|
213 | } | |
212 |
|
214 | |||
213 | $prefix = "c:\hgdev" |
|
215 | $prefix = "c:\hgdev" | |
214 | Install-Dependencies $prefix |
|
216 | Install-Dependencies $prefix | |
215 | Clone-Mercurial-Repo $prefix "https://www.mercurial-scm.org/repo/hg" $prefix\src |
|
217 | Clone-Mercurial-Repo $prefix "https://www.mercurial-scm.org/repo/hg" $prefix\src |
General Comments 0
You need to be logged in to leave comments.
Login now