@echo off
:: EAA AirVenture Oshkosh — 10-second wallpaper (Windows 10/11)
:: Your wallpaper becomes the 7-camera AirVenture grid, refreshing every ~10s.
:: Every camera frame downloads DIRECTLY from YouTube's servers to YOUR PC —
:: nothing streams through dizydiz.com. On July 27 it restores your original
:: wallpaper and removes itself. Uninstall early:  oshkosh-wallpaper.bat uninstall
setlocal
set DIR=%LOCALAPPDATA%\OshkoshWallpaper
set BASE=https://dizydiz.com/oshkosh

if /i "%1"=="uninstall" goto :uninstall
mkdir "%DIR%" 2>nul

:: save current wallpaper once
if not exist "%DIR%\saved-wallpaper.txt" (
  powershell -NoProfile -Command "(Get-ItemProperty 'HKCU:\Control Panel\Desktop').Wallpaper | Out-File -Encoding utf8 '%DIR%\saved-wallpaper.txt'"
)

:: download the refresher SCRIPT (code only — the media it fetches comes from YouTube)
curl -s -o "%DIR%\refresh.ps1" %BASE%/refresh.ps1
if not exist "%DIR%\refresh.ps1" ( echo Could not download the script — check your connection. & pause & exit /b 1 )

schtasks /Create /F /TN OshkoshWallpaper /SC MINUTE /MO 1 ^
  /TR "powershell -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File \"%DIR%\refresh.ps1\"" >nul
powershell -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File "%DIR%\refresh.ps1"

echo.
echo  ============================================================
echo   Oshkosh Camera Wallpaper is ON! Refreshes every ~10 seconds.
echo   Frames come straight from YouTube to your PC (not via us).
echo   Restores your wallpaper + removes itself on July 27.
echo   Uninstall early:  oshkosh-wallpaper.bat uninstall
echo  ============================================================
pause
exit /b

:uninstall
powershell -NoProfile -ExecutionPolicy Bypass -File "%DIR%\refresh.ps1" -Uninstall
echo Removed - your original wallpaper is restored.
pause
