Last active
January 23, 2024 04:24
-
-
Save SnoFox/bc1282f5163d71a1ff1a6f358390f4f6 to your computer and use it in GitHub Desktop.
Update retroarch cores for Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory)] | |
[string]$CoreName | |
) | |
echo "Updating RetroArch core '$CoreName'..." | |
$url = "https://buildbot.libretro.com/nightly/windows/x86_64/latest/$($CoreName)_libretro.dll.zip" | |
$retroHome = "Z:\Games\SteamLibrary\steamapps\common\RetroArch\" | |
$tempDir = New-Item -ItemType Directory -Path "$($Env:temp)\tmp$([convert]::tostring((get-random 65535),16).padleft(4,'0')).tmp" | |
$zipFile = $tempDir.FullName + "\core.zip" | |
$infoZipFile = $tempDir.FullName + "\info.zip" | |
echo "Downloading core zip..." | |
Invoke-WebRequest -Uri $url -OutFile $zipFile | |
echo "Downloading info zip..." | |
Invoke-WebRequest -Uri https://buildbot.libretro.com/assets/frontend/info.zip -OutFile $infoZipFile | |
echo "Extracting and moving..." | |
Expand-Archive -LiteralPath $zipFile -DestinationPath $tempDir | |
Expand-Archive -LiteralPath $infoZipFile -DestinationPath $tempDir | |
Move-Item -LiteralPath $tempDir/$($CoreName)_libretro.dll -Destination $($retroHome + "cores\") -Force | |
Move-Item -LiteralPath $tempDir/$($CoreName)_libretro.info -Destination $($retroHome + "info\") -Force | |
echo "Cleaning up tempdir..." | |
Remove-Item -Path $tempDir -Recurse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment