-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathUpdateToolchain.ps1
82 lines (69 loc) · 2.67 KB
/
UpdateToolchain.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
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
$filepath = "$PSScriptRoot/temp/"
New-Item -ItemType Directory -Force -Path $filepath
$url = "https://github.com/n64-tools/libdragon/releases/download/develop-dragonminded-windows-tools-latest/libdragon-library.zip"
$output = "$PSScriptRoot/temp/libdragon.zip"
$destination = "$PSScriptRoot/toolchain/libdragon/"
if (Test-Path $output)
{
Remove-Item -LiteralPath $output -Force -Recurse
}
Write-Host "Downloading Libdragon..."
(New-Object Net.WebClient).Downloadfile($url , $output)
if (Test-Path $destination)
{
Remove-Item -LiteralPath $destination -Force -Recurse
}
Expand-Archive -Force -Path $output -DestinationPath $destination
Write-Host "Downloaded Libdragon successfully."
$url = "https://github.com/n64-tools/libdragon/releases/download/develop-dragonminded-windows-tools-latest/libdragon-tools-win_x86_64.zip"
$output = "$PSScriptRoot/temp/libdragon-tools.zip"
$destination = "$PSScriptRoot/toolchain/libdragon/"
if (Test-Path $output)
{
Remove-Item -LiteralPath $output -Force -Recurse
}
Write-Host "Downloading Libdragon tools..."
(New-Object Net.WebClient).Downloadfile($url , $output)
# if (Test-Path $destination)
# {
# Remove-Item -LiteralPath $destination -Force -Recurse
# }
Expand-Archive -Force -Path $output -DestinationPath $destination
Write-Host "Downloaded Libdragon tools successfully."
$url = "https://github.com/n64-tools/gcc-toolchain-mips64/releases/download/latest/gcc-toolchain-mips64-win64.zip"
$output = "$PSScriptRoot/temp/gcc-toolchain-mips64.zip"
$destination = "$PSScriptRoot/toolchain/gcc-toolchain-mips64/"
if (Test-Path $output)
{
Remove-Item -LiteralPath $output -Force -Recurse
}
Write-Host "Downloading GCC..."
(New-Object Net.WebClient).Downloadfile($url , $output)
if (Test-Path $destination)
{
Remove-Item -LiteralPath $destination -Force -Recurse
}
Expand-Archive -Force -Path $output -DestinationPath $destination
Write-Host "Downloaded GCC Toolchain successfully."
$url = "https://github.com/ninja-build/ninja/releases/latest/download/ninja-win.zip"
$output = "$PSScriptRoot/temp/ninja.zip"
$destination = "$PSScriptRoot/tools/"
if (Test-Path $output)
{
Remove-Item -LiteralPath $output -Force -Recurse
}
Write-Host "Downloading Ninja-Build..."
(New-Object Net.WebClient).Downloadfile($url , $output)
if (Test-Path $destination)
{
Remove-Item -LiteralPath $destination -Force -Recurse
}
Expand-Archive -Force -Path $output -DestinationPath $destination
Write-Host "Downloaded Ninja-Build successfully."
$filepath = "$PSScriptRoot/temp/"
if (Test-Path $filepath)
{
Remove-Item -LiteralPath $filepath -Force -Recurse
}
Write-Host "Finished cleanup of temp directories.."
Write-Host "Toolchain install completed sucessfully."