forked from ffmpeginteropx/FFmpegInteropX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstallTools.ps1
More file actions
77 lines (60 loc) · 2.27 KB
/
InstallTools.ps1
File metadata and controls
77 lines (60 loc) · 2.27 KB
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
param(
[ValidateSet('MSYS2', 'nasm', 'perl')]
[string[]] $Tools = ('MSYS2', 'nasm', 'perl'),
[string] $NasmVersion = "2.15.05",
[string] $PerlVersion = "5.32.1.1"
)
# Stop on all PowerShell command errors
$ErrorActionPreference = "Stop"
New-Item -ItemType Directory -Path $PSScriptRoot\Tools -Force -OutVariable root
if ($Tools.Contains("MSYS2"))
{
if (!(Test-Path "C:\msys64"))
{
Write-Host
Write-Host "Installing MSYS2..."
Write-Host
# Download and install MSYS2
curl.exe -SL --output msys2-x86_64-latest.sfx.exe https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe
.\msys2-x86_64-latest.sfx.exe -oC:\
Remove-Item .\msys2-x86_64-latest.sfx.exe
# Install MSYS2 dependencies
C:\msys64\usr\bin\bash.exe --login -c "pacman --noconfirm -Syu"
C:\msys64\usr\bin\bash.exe --login -c "pacman --noconfirm -Su"
C:\msys64\usr\bin\bash.exe --login -c "pacman --noconfirm -S make perl diffutils yasm nasm mingw-w64-x86_64-meson mingw-w64-x86_64-ninja"
C:\msys64\usr\bin\bash.exe --login -c "pacman --noconfirm -Scc"
}
else
{
Write-Host
Write-Host "Updating MSYS2 packages..."
Write-Host
C:\msys64\usr\bin\bash.exe --login -c "pacman --noconfirm -Syu"
C:\msys64\usr\bin\bash.exe --login -c "pacman --noconfirm -Scc"
}
}
if ($Tools.Contains("nasm"))
{
Write-Host
Write-Host "Installing NASM..."
Write-Host
$temp = "$root\nasm-$NasmVersion"
$target = "$root\nasm"
Remove-Item $temp -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item $target -Recurse -Force -ErrorAction SilentlyContinue
curl.exe -SL --output nasm.zip https://www.nasm.us/pub/nasm/releasebuilds/$NasmVersion/win64/nasm-$NasmVersion-win64.zip
Expand-Archive -Path nasm.zip -DestinationPath $root
Rename-Item -Path $temp -NewName "nasm"
Remove-Item .\nasm.zip
}
if ($Tools.Contains("perl"))
{
Write-Host
Write-Host "Installing Perl..."
Write-Host
$target = "$root\perl"
Remove-Item $target -Recurse -Force -ErrorAction SilentlyContinue
curl.exe -SL --output perl.zip https://strawberryperl.com/download/$PerlVersion/strawberry-perl-$PerlVersion-64bit-portable.zip
Expand-Archive -Path perl.zip -DestinationPath $target
Remove-Item .\perl.zip
}