Repository navigation
Expand file tree
/
Copy pathsetup.ps1
More file actions
35 lines (35 loc) · 1.72 KB
/
Copy pathsetup.ps1
File metadata and controls
35 lines (35 loc) · 1.72 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
# Downloads the two player binaries into player\ and verifies their SHA-256 hashes.
# mpv.exe is hosted in this project's GitHub release because it exceeds git's
# 100 MB file limit; yt-dlp.exe comes straight from the official yt-dlp release.
param(
[string]$MpvUrl = 'https://github.com/csszyft/GuidePad/releases/download/v1.0/mpv.exe',
[string]$YtdlpUrl = 'https://github.com/yt-dlp/yt-dlp/releases/download/2026.10.21/yt-dlp.exe'
)
$ErrorActionPreference = 'Stop'
$expected = [ordered]@{
'mpv.exe' = '8c2e4d24eb961723cc5e2f1f4401982836e82c96e0e0a944c0576090fc48993f'
'yt-dlp.exe' = '33121d192d706e62f684a06f80918e3f3a8ba52ac3a65213b6951c39c7d9f555'
}
$sources = @{
'mpv.exe' = $MpvUrl
'yt-dlp.exe' = $YtdlpUrl
}
foreach ($name in $expected.Keys) {
$target = Join-Path $PSScriptRoot (Join-Path 'player' $name)
if (Test-Path -LiteralPath $target) {
$hash = (Get-FileHash -LiteralPath $target -Algorithm SHA256).Hash.ToLowerInvariant()
if ($hash -eq $expected[$name]) {
Write-Host "$name already present, hash OK."
continue
}
Write-Host "$name exists but its hash does not match; downloading a fresh copy."
Remove-Item -LiteralPath $target -Force
}
Write-Host "Downloading $name ..."
& curl.exe -sSL -o $target $sources[$name]
if ($LASTEXITCODE -ne 0) { throw "Failed to download $name from $($sources[$name])" }
$hash = (Get-FileHash -LiteralPath $target -Algorithm SHA256).Hash.ToLowerInvariant()
if ($hash -ne $expected[$name]) { throw "SHA-256 mismatch for $name`n expected $($expected[$name])`n actual $hash" }
Write-Host "$name downloaded, hash OK."
}
Write-Host 'Player setup complete. You can now start GuidePad.exe.'