@echo off
rem Double-clickable installer for the Playground launcher.
rem
rem A .ps1 opens in Notepad when you double-click it, and a downloaded script is
rem blocked by the default execution policy. A .cmd has neither problem, so this
rem is the one file on the package page that a Windows machine can just run.
rem
rem It installs the launcher under %LOCALAPPDATA%\playground, puts a Playground
rem shortcut on the Desktop and Start Menu, and starts the game. After this you
rem never need it again - the Desktop shortcut updates itself on every launch.

setlocal
set URL=https://git.kennethblack.me/api/packages/kblack0610/generic/unity-core-playground/latest/play.ps1

echo Installing the Playground launcher...
echo.

powershell -NoProfile -ExecutionPolicy Bypass -Command ^
  "[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; irm '%URL%' | iex"

if errorlevel 1 (
    echo.
    echo Install failed. The error is above this line.
    pause
)
