• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 # Download new TLS certs from Windows Update
2 Get-Date
3 Write-Host "Updating TLS certificate store"
4 Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "_tlscerts" | Out-Null
5 $certdir = (New-Item -ItemType Directory -Name "_tlscerts")
6 certutil -syncwithWU "$certdir"
7 Foreach ($file in (Get-ChildItem -Path "$certdir\*" -Include "*.crt")) {
8   Import-Certificate -FilePath $file -CertStoreLocation Cert:\LocalMachine\Root | Out-Null
9 }
10 Remove-Item -Recurse -Path $certdir
11 
12 
13 Get-Date
14 Write-Host "Installing Chocolatey"
15 Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
16 Import-Module "$env:ProgramData\chocolatey\helpers\chocolateyProfile.psm1"
17 Update-SessionEnvironment
18 Write-Host "Installing Chocolatey packages"
19 
20 # Chocolatey tries to download winflexbison from SourceForge, which is not super reliable, and has no retry
21 # loop of its own - so we give it a helping hand here
22 For ($i = 0; $i -lt 5; $i++) {
23   choco install --no-progress -y python3 --params="/InstallDir:C:\python3"
24   $python_install = $?
25   choco install --allow-empty-checksums --no-progress -y cmake git git-lfs ninja pkgconfiglite winflexbison --installargs "ADD_CMAKE_TO_PATH=System"
26   $other_install = $?
27   $choco_installed = $other_install -and $python_install
28   if ($choco_installed) {
29     Break
30   }
31 }
32 
33 if (!$choco_installed) {
34   Write-Host "Couldn't install dependencies from Chocolatey"
35   Exit 1
36 }
37 
38 # Add Chocolatey's native install path
39 Update-SessionEnvironment
40 # Python and CMake add themselves to the system environment path, which doesn't get refreshed
41 # until we start a new shell
42 $env:PATH = "C:\python3;C:\python3\scripts;C:\Program Files\CMake\bin;$env:PATH"
43 
44 Start-Process -NoNewWindow -Wait git -ArgumentList 'config --global core.autocrlf false'
45 
46 Get-Date
47 Write-Host "Installing Meson, Mako and numpy"
48 pip3 install meson mako numpy --progress-bar off
49 if (!$?) {
50   Write-Host "Failed to install dependencies from pip"
51   Exit 1
52 }
53 
54 Get-Date
55 Write-Host "Downloading Vulkan-SDK"
56 Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanSDK-$env:VULKAN_SDK_VERSION-Installer.exe" -OutFile 'C:\vulkan_sdk.exe'
57 C:\vulkan_sdk.exe --am --al -c in
58 if (!$?) {
59     Write-Host "Failed to install Vulkan SDK"
60     Exit 1
61 }
62 Remove-Item C:\vulkan_sdk.exe -Force
63 
64 Get-Date
65 Write-Host "Downloading Vulkan-Runtime"
66 Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanRT-$env:VULKAN_SDK_VERSION-Installer.exe" -OutFile 'C:\vulkan-runtime.exe' | Out-Null
67 Write-Host "Installing Vulkan-Runtime"
68 Start-Process -NoNewWindow -Wait C:\vulkan-runtime.exe -ArgumentList '/S'
69 if (!$?) {
70   Write-Host "Failed to install Vulkan-Runtime"
71   Exit 1
72 }
73 Remove-Item C:\vulkan-runtime.exe -Force
74