confOS/windows/installers/collapse.bat

24 lines
679 B
Batchfile
Raw Permalink Normal View History

2024-07-02 12:15:42 +02:00
@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