Add one-click installers for admin and user batch scripts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
65a5780e02
commit
f8d02dfc70
9 files changed
+91
-20
No files matched your search
@@ -0,0 +1,40 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal EnableDelayedExpansion
|
||||||
|
title Install all tools (administrator)
|
||||||
|
|
||||||
|
rem Runs every ??-Install-*-Admin.bat next to this file in numeric order.
|
||||||
|
rem Run 00-Install-All-User.bat afterwards, as the user who will use the tools.
|
||||||
|
|
||||||
|
fltmc >nul 2>&1
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo Please right-click this file and choose "Run as administrator".
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
rem The child scripts skip their final pause when this is set.
|
||||||
|
set "INSTALL_ALL=1"
|
||||||
|
set "FAILED="
|
||||||
|
set "REBOOT="
|
||||||
|
|
||||||
|
for %%F in ("%~dp0??-Install-*-Admin.bat") do (
|
||||||
|
if /i not "%%~nxF"=="%~nx0" (
|
||||||
|
echo.
|
||||||
|
echo ===== %%~nxF =====
|
||||||
|
call "%%F"
|
||||||
|
set "RC=!ERRORLEVEL!"
|
||||||
|
if "!RC!"=="3010" set "REBOOT=1"
|
||||||
|
if not "!RC!"=="0" if not "!RC!"=="3010" set "FAILED=!FAILED! %%~nxF"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
echo.
|
||||||
|
if defined FAILED (
|
||||||
|
echo Failed:%FAILED%
|
||||||
|
) else (
|
||||||
|
echo All administrator installers finished.
|
||||||
|
)
|
||||||
|
if defined REBOOT echo A reboot is required to finish some installations.
|
||||||
|
pause
|
||||||
|
if defined FAILED exit /b 1
|
||||||
|
exit /b 0
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal EnableDelayedExpansion
|
||||||
|
title Install all tools (current user)
|
||||||
|
|
||||||
|
rem Runs every ??-Install-*.bat next to this file that does not need administrator
|
||||||
|
rem rights (the ones not named *-Admin.bat), in numeric order.
|
||||||
|
rem Run this as the user who will use the tools, not as administrator.
|
||||||
|
|
||||||
|
rem The child scripts skip their final pause when this is set.
|
||||||
|
set "INSTALL_ALL=1"
|
||||||
|
set "FAILED="
|
||||||
|
|
||||||
|
for %%F in ("%~dp0??-Install-*.bat") do (
|
||||||
|
set "NAME=%%~nF"
|
||||||
|
if /i not "%%~nxF"=="%~nx0" if /i not "!NAME:~-6!"=="-Admin" (
|
||||||
|
echo.
|
||||||
|
echo ===== %%~nxF =====
|
||||||
|
call "%%F"
|
||||||
|
if errorlevel 1 set "FAILED=!FAILED! %%~nxF"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
echo.
|
||||||
|
if defined FAILED (
|
||||||
|
echo Failed:%FAILED%
|
||||||
|
) else (
|
||||||
|
echo All user installers finished.
|
||||||
|
)
|
||||||
|
pause
|
||||||
|
if defined FAILED exit /b 1
|
||||||
|
exit /b 0
|
||||||
@@ -5,14 +5,14 @@ title Install Git for Windows
|
|||||||
fltmc >nul 2>&1
|
fltmc >nul 2>&1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo Please right-click this file and choose "Run as administrator".
|
echo Please right-click this file and choose "Run as administrator".
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
where winget.exe >nul 2>&1
|
where winget.exe >nul 2>&1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo winget was not found.
|
echo winget was not found.
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -28,5 +28,5 @@ if "%RC%"=="0" (
|
|||||||
) else (
|
) else (
|
||||||
echo winget exited with code %RC%.
|
echo winget exited with code %RC%.
|
||||||
)
|
)
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b %RC%
|
exit /b %RC%
|
||||||
@@ -5,14 +5,14 @@ title Install MSVC 2022 Build Tools
|
|||||||
fltmc >nul 2>&1
|
fltmc >nul 2>&1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo Please right-click this file and choose "Run as administrator".
|
echo Please right-click this file and choose "Run as administrator".
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
where winget.exe >nul 2>&1
|
where winget.exe >nul 2>&1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo winget was not found.
|
echo winget was not found.
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -29,5 +29,5 @@ if "%RC%"=="0" (
|
|||||||
) else (
|
) else (
|
||||||
echo winget exited with code %RC%.
|
echo winget exited with code %RC%.
|
||||||
)
|
)
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b %RC%
|
exit /b %RC%
|
||||||
@@ -5,14 +5,14 @@ title Install CMake
|
|||||||
fltmc >nul 2>&1
|
fltmc >nul 2>&1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo Please right-click this file and choose "Run as administrator".
|
echo Please right-click this file and choose "Run as administrator".
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
where winget.exe >nul 2>&1
|
where winget.exe >nul 2>&1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo winget was not found.
|
echo winget was not found.
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -29,5 +29,5 @@ if "%RC%"=="0" (
|
|||||||
) else (
|
) else (
|
||||||
echo winget exited with code %RC%.
|
echo winget exited with code %RC%.
|
||||||
)
|
)
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b %RC%
|
exit /b %RC%
|
||||||
@@ -20,7 +20,7 @@ echo Downloading rustup-init (%RUSTUP_ARCH%)...
|
|||||||
curl.exe -L --fail -o "%INSTALLER%" https://win.rustup.rs/%RUSTUP_ARCH%
|
curl.exe -L --fail -o "%INSTALLER%" https://win.rustup.rs/%RUSTUP_ARCH%
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo Download failed.
|
echo Download failed.
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -35,5 +35,5 @@ if "%RC%"=="0" (
|
|||||||
) else (
|
) else (
|
||||||
echo rustup-init exited with code %RC%.
|
echo rustup-init exited with code %RC%.
|
||||||
)
|
)
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b %RC%
|
exit /b %RC%
|
||||||
@@ -5,14 +5,14 @@ title Install NSIS
|
|||||||
fltmc >nul 2>&1
|
fltmc >nul 2>&1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo Please right-click this file and choose "Run as administrator".
|
echo Please right-click this file and choose "Run as administrator".
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
where winget.exe >nul 2>&1
|
where winget.exe >nul 2>&1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo winget was not found.
|
echo winget was not found.
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -28,5 +28,5 @@ if "%RC%"=="0" (
|
|||||||
) else (
|
) else (
|
||||||
echo winget exited with code %RC%.
|
echo winget exited with code %RC%.
|
||||||
)
|
)
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b %RC%
|
exit /b %RC%
|
||||||
@@ -26,7 +26,7 @@ echo Downloading aqtinstall...
|
|||||||
curl.exe -L --fail -o "%AQT%" https://github.com/miurahr/aqtinstall/releases/download/v3.3.0/aqt_x64.exe
|
curl.exe -L --fail -o "%AQT%" https://github.com/miurahr/aqtinstall/releases/download/v3.3.0/aqt_x64.exe
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo Download failed.
|
echo Download failed.
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -41,5 +41,5 @@ if "%RC%"=="0" (
|
|||||||
) else (
|
) else (
|
||||||
echo aqt exited with code %RC%.
|
echo aqt exited with code %RC%.
|
||||||
)
|
)
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b %RC%
|
exit /b %RC%
|
||||||
@@ -5,7 +5,7 @@ title Install ws2tcp-local
|
|||||||
fltmc >nul 2>&1
|
fltmc >nul 2>&1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo Please right-click this file and choose "Run as administrator".
|
echo Please right-click this file and choose "Run as administrator".
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ set "URL="
|
|||||||
for /f "usebackq delims=" %%U in (`powershell -NoProfile -ExecutionPolicy Bypass -Command "(Invoke-RestMethod -UseBasicParsing '%MANIFEST%').windows_url"`) do set "URL=%%U"
|
for /f "usebackq delims=" %%U in (`powershell -NoProfile -ExecutionPolicy Bypass -Command "(Invoke-RestMethod -UseBasicParsing '%MANIFEST%').windows_url"`) do set "URL=%%U"
|
||||||
if not defined URL (
|
if not defined URL (
|
||||||
echo Could not read the download URL from %MANIFEST%.
|
echo Could not read the download URL from %MANIFEST%.
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ echo Downloading %URL%...
|
|||||||
curl.exe -fL --retry 3 -o "%INSTALLER%" "%URL%"
|
curl.exe -fL --retry 3 -o "%INSTALLER%" "%URL%"
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
echo Download failed.
|
echo Download failed.
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ if "%RC%"=="0" (
|
|||||||
) else (
|
) else (
|
||||||
echo The installer exited with code %RC%.
|
echo The installer exited with code %RC%.
|
||||||
)
|
)
|
||||||
pause
|
if not defined INSTALL_ALL pause
|
||||||
exit /b %RC%
|
exit /b %RC%
|
||||||
|
|
||||||
:desktop_shortcut
|
:desktop_shortcut
|
||||||
|
|||||||
Reference in new issue
Block a user