confOS/windows/installers/collapse.bat
2024-07-02 12:15:42 +02:00

23 lines
679 B
Batchfile

@ECHO OFF
:: Start as administrator
fltmc >NUL 2>&1 || (
PowerShell Start -Verb RunAs '%0' 2>NUL || (
EXIT 1
)
EXIT 0
)
ECHO Collapse...
PowerShell -Command "" ^
"$repo = 'CollapseLauncher/Collapse';" ^
"$releases = \"https://api.github.com/repos/$repo/releases/latest\";" ^
"$link = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].assets.browser_download_url[0];" ^
"$exe = 'collapse-installer.exe';" ^
"$outFile = Join-Path -Path $env:TEMP -ChildPath $exe;" ^
"Invoke-WebRequest -Uri $link -OutFile $outFile;" ^
"Start-Process -Wait $outFile '/SUPPRESSMSGBOXES', '/VERYSILENT';" ^
"Remove-Item -Force $outFile"
IF NOT "%1"=="yes" PAUSE
EXIT /B