34 lines
853 B
Batchfile
34 lines
853 B
Batchfile
@echo off
|
|
setlocal
|
|
title Install CMake
|
|
|
|
fltmc >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo Please right-click this file and choose "Run as administrator".
|
|
if not defined INSTALL_ALL pause
|
|
exit /b 1
|
|
)
|
|
|
|
where winget.exe >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo winget was not found.
|
|
if not defined INSTALL_ALL pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo Installing CMake with winget...
|
|
winget install --id Kitware.CMake --exact --source winget ^
|
|
--accept-source-agreements --accept-package-agreements ^
|
|
--custom "ADD_CMAKE_TO_PATH=System"
|
|
set "RC=%ERRORLEVEL%"
|
|
|
|
if "%RC%"=="0" (
|
|
echo Done. Open a new terminal to pick up the updated PATH.
|
|
) else if "%RC%"=="3010" (
|
|
echo Done. A reboot is required to finish the installation.
|
|
) else (
|
|
echo winget exited with code %RC%.
|
|
)
|
|
if not defined INSTALL_ALL pause
|
|
exit /b %RC%
|