@echo off
setlocal
title Elm City Computing Updater

set "LAUNCHER_VERSION=1.1.0"

echo.
echo ============================================================
echo Elm City Computing Updater Launcher v%LAUNCHER_VERSION%
echo ============================================================
echo.
echo Downloading latest Elm City Updater...

powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$u='https://elmcitycomputing.com/tools/ElmCityUpdater.ps1?nocache='+[DateTimeOffset]::UtcNow.ToUnixTimeSeconds();$f=Join-Path $env:TEMP 'ElmCityUpdater.ps1';Invoke-WebRequest -Uri $u -OutFile $f -UseBasicParsing;Unblock-File -LiteralPath $f;Start-Process powershell.exe -Verb RunAs -ArgumentList ('-NoProfile -ExecutionPolicy Bypass -File """'+$f+'""" -LauncherVersion """%LAUNCHER_VERSION%"""')"

if errorlevel 1 (
    echo.
    echo Elm City Updater launcher encountered an error.
    pause
)

endlocal
