Skip to content

Instantly share code, notes, and snippets.

@SnoFox
Last active January 23, 2024 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SnoFox/bc1282f5163d71a1ff1a6f358390f4f6 to your computer and use it in GitHub Desktop.
Save SnoFox/bc1282f5163d71a1ff1a6f358390f4f6 to your computer and use it in GitHub Desktop.
Update retroarch cores for Windows
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