forked from microsoft/msquic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-build-artifacts.ps1
57 lines (43 loc) · 1.5 KB
/
install-build-artifacts.ps1
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
<#
.SYNOPSIS
Installs the build artifacts on a test machine.
.PARAMETER Config
Specifies the build configuration to test.
.PARAMETER Arch
The CPU architecture to test.
.PARAMETER Tls
The TLS library test.
.EXAMPLE
install-build-artifacts.ps1
#>
param (
[Parameter(Mandatory = $false)]
[ValidateSet("Debug", "Release")]
[string]$Config = "Release",
[Parameter(Mandatory = $true)]
[ValidateSet("x86", "x64", "arm", "arm64", "universal")]
[string]$Arch,
[Parameter(Mandatory = $true)]
[ValidateSet("schannel", "openssl", "openssl3")]
[string]$Tls
)
Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
# Important directories.
$RootDir = Split-Path $PSScriptRoot -Parent
$ArtifactsDir = Join-Path $RootDir "artifacts/bin"
if ($IsWindows) {
if (!(Test-Path "C:\Windows\System32\drivers\msquic.sys")) {
# Install ETW manifest, if not already present
$MsQuicDll = Join-Path $ArtifactsDir "\windows\$($Arch)_$($Config)_$($Tls)\msquic.dll"
$ManifestPath = Join-Path $RootDir "\src\manifest\MsQuicEtw.man"
$Command = "wevtutil.exe im $($ManifestPath) /rf:$($MsQuicDll) /mf:$($MsQuicDll)"
Write-Host $Command
Invoke-Expression $Command
}
} elseif ($IsLinux -or $IsMacOS) {
# TODO - Figure out how to install openssl?
# Make sure we have full permissions for all artifacts.
Write-Host "[$(Get-Date)] Configuring permissions for artifacts..."
sudo chmod -R 777 $ArtifactsDir
}