@echo off set "DEST_DIR=%~dp0" set "ZIP_FILE=%~dp0ppsspp_dev_temp.zip" echo =================================================== echo PPSSPP JSON-BASED DEV AUTO-UPDATER echo =================================================== echo. :: 1. Fetch the latest version string from the JSON first for /f "delims=" %%A in ('powershell -NoProfile -ExecutionPolicy Bypass -Command "$json = Invoke-RestMethod -Uri 'https://builds.ppsspp.org/meta/history-20.json'; if ($json[0]) { write-output $json[0].description }"') do set "LATEST_VERSION=%%A" if "%LATEST_VERSION%"=="" ( echo Error: Could not fetch version metadata from JSON feed. goto LAUNCH ) echo Latest available build: %LATEST_VERSION% :: 2. Check your local EXE property directly for the product version if exist "%DEST_DIR%PPSSPPWindows64.exe" ( for /f "delims=" %%B in ('powershell -NoProfile -ExecutionPolicy Bypass -Command "(Get-Item '%DEST_DIR%PPSSPPWindows64.exe').VersionInfo.ProductVersion"') do set "LOCAL_VERSION=%%B" ) else ( set "LOCAL_VERSION=None" ) echo Your current build: %LOCAL_VERSION% echo. :: 3. Jump straight to launching if already up to date if "%LATEST_VERSION%"=="%LOCAL_VERSION%" ( echo [!] You are currently up to date. goto LAUNCH ) else ( echo [*] A different version is available. ) set /p "CHOICE=Do you want to run the update now? (Y/N): " echo. if /i "%CHOICE%"=="Y" ( goto UPDATE ) else ( goto LAUNCH ) :UPDATE echo [1/4] Closing running instances of PPSSPP... taskkill /f /im PPSSPPWindows64.exe 2>nul taskkill /f /im PPSSPPWindows.exe 2>nul echo [2/4] Executing download and extraction... powershell -NoProfile -ExecutionPolicy Bypass -Command "$json = Invoke-RestMethod -Uri 'https://builds.ppsspp.org/meta/history-20.json'; $latest = $json[0]; $folder = $latest.description; $fileName = $latest.builds.Windows[0]; $url = 'https://builds.ppsspp.org/builds/' + $folder + '/' + $fileName; Write-Host '[3/4] Downloading package...'; Invoke-WebRequest -Uri $url -OutFile '%ZIP_FILE%'; Write-Host '[4/4] Extracting core components...'; Expand-Archive -Path '%ZIP_FILE%' -DestinationPath '%DEST_DIR%' -Force; Write-Host 'Success! PPSSPP updated.' -ForegroundColor Green;" echo. echo [5/5] Cleaning up temporary download... timeout /t 2 /nobreak >nul if exist "%ZIP_FILE%" del /f /q "%ZIP_FILE%" :LAUNCH echo. echo Launching PPSSPP... if exist "%DEST_DIR%PPSSPPWindows64.exe" ( start "" "%DEST_DIR%PPSSPPWindows64.exe" ) else ( echo Error: PPSSPPWindows64.exe not found in this directory. echo =================================================== pause exit ) echo =================================================== timeout /t 1 >nul exit