@echo off setlocal set "SELMA_BOOTSTRAP=%TEMP%\SELMA-Install-%RANDOM%.ps1" powershell.exe -NoProfile -Command "[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -UseBasicParsing -Uri 'https://vps2.happyuser.info/selma-app/Install-SELMA.ps1' -OutFile '%SELMA_BOOTSTRAP%'" if errorlevel 1 (echo Could not download the SELMA installer.& pause & exit /b 2) for /f "tokens=*" %%H in ('certutil -hashfile "%SELMA_BOOTSTRAP%" SHA256 ^| findstr /R /I "^[0-9A-F][0-9A-F]*$"') do set "SELMA_HASH=%%H" if /I not "%SELMA_HASH%"=="0ac223eadb911cc15961c7162b71b8d758923e8f5137a80294592136dccbb6bc" (echo SELMA installer verification failed.& del "%SELMA_BOOTSTRAP%" & pause & exit /b 2) if /I "%~1"=="--check" (powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%SELMA_BOOTSTRAP%" -CheckOnly) else if /I "%~1"=="--fresh" (powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%SELMA_BOOTSTRAP%" -Fresh) else (powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%SELMA_BOOTSTRAP%") set "SELMA_EXIT=%ERRORLEVEL%" del "%SELMA_BOOTSTRAP%" >nul 2>nul exit /b %SELMA_EXIT%