From f8d02dfc70a5d62e66a0f5de722271f040478cce Mon Sep 17 00:00:00 2001 From: Guofang Date: Tue, 20 Oct 2026 12:52:17 +0800 Subject: [PATCH] Add one-click installers for admin and user batch scripts Co-Authored-By: Claude Sonnet 5.5 --- seediso/windows11/00-Install-All-Admin.bat | 40 +++++++++++++++++++ seediso/windows11/00-Install-All-User.bat | 31 ++++++++++++++ seediso/windows11/10-Install-Git-Admin.bat | 6 +-- seediso/windows11/20-Install-MSVC-Admin.bat | 6 +-- seediso/windows11/30-Install-CMake-Admin.bat | 6 +-- seediso/windows11/40-Install-Rustup.bat | 4 +- seediso/windows11/50-Install-NSIS-Admin.bat | 6 +-- seediso/windows11/60-Install-Qt6.bat | 4 +- .../70-Install-ws2tcp-local-Admin.bat | 8 ++-- 9 files changed, 91 insertions(+), 20 deletions(-) create mode 100644 seediso/windows11/00-Install-All-Admin.bat create mode 100644 seediso/windows11/00-Install-All-User.bat diff --git a/seediso/windows11/00-Install-All-Admin.bat b/seediso/windows11/00-Install-All-Admin.bat new file mode 100644 index 0000000..0463c3f --- /dev/null +++ b/seediso/windows11/00-Install-All-Admin.bat @@ -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 diff --git a/seediso/windows11/00-Install-All-User.bat b/seediso/windows11/00-Install-All-User.bat new file mode 100644 index 0000000..3a7770d --- /dev/null +++ b/seediso/windows11/00-Install-All-User.bat @@ -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 diff --git a/seediso/windows11/10-Install-Git-Admin.bat b/seediso/windows11/10-Install-Git-Admin.bat index 97e70a2..f7fe429 100644 --- a/seediso/windows11/10-Install-Git-Admin.bat +++ b/seediso/windows11/10-Install-Git-Admin.bat @@ -5,14 +5,14 @@ title Install Git for Windows fltmc >nul 2>&1 if errorlevel 1 ( echo Please right-click this file and choose "Run as administrator". - pause + if not defined INSTALL_ALL pause exit /b 1 ) where winget.exe >nul 2>&1 if errorlevel 1 ( echo winget was not found. - pause + if not defined INSTALL_ALL pause exit /b 1 ) @@ -28,5 +28,5 @@ if "%RC%"=="0" ( ) else ( echo winget exited with code %RC%. ) -pause +if not defined INSTALL_ALL pause exit /b %RC% diff --git a/seediso/windows11/20-Install-MSVC-Admin.bat b/seediso/windows11/20-Install-MSVC-Admin.bat index c3017b0..6cdf61f 100644 --- a/seediso/windows11/20-Install-MSVC-Admin.bat +++ b/seediso/windows11/20-Install-MSVC-Admin.bat @@ -5,14 +5,14 @@ title Install MSVC 2022 Build Tools fltmc >nul 2>&1 if errorlevel 1 ( echo Please right-click this file and choose "Run as administrator". - pause + if not defined INSTALL_ALL pause exit /b 1 ) where winget.exe >nul 2>&1 if errorlevel 1 ( echo winget was not found. - pause + if not defined INSTALL_ALL pause exit /b 1 ) @@ -29,5 +29,5 @@ if "%RC%"=="0" ( ) else ( echo winget exited with code %RC%. ) -pause +if not defined INSTALL_ALL pause exit /b %RC% diff --git a/seediso/windows11/30-Install-CMake-Admin.bat b/seediso/windows11/30-Install-CMake-Admin.bat index af7edb4..2988a5e 100644 --- a/seediso/windows11/30-Install-CMake-Admin.bat +++ b/seediso/windows11/30-Install-CMake-Admin.bat @@ -5,14 +5,14 @@ title Install CMake fltmc >nul 2>&1 if errorlevel 1 ( echo Please right-click this file and choose "Run as administrator". - pause + if not defined INSTALL_ALL pause exit /b 1 ) where winget.exe >nul 2>&1 if errorlevel 1 ( echo winget was not found. - pause + if not defined INSTALL_ALL pause exit /b 1 ) @@ -29,5 +29,5 @@ if "%RC%"=="0" ( ) else ( echo winget exited with code %RC%. ) -pause +if not defined INSTALL_ALL pause exit /b %RC% diff --git a/seediso/windows11/40-Install-Rustup.bat b/seediso/windows11/40-Install-Rustup.bat index 0e85a01..bfb386b 100644 --- a/seediso/windows11/40-Install-Rustup.bat +++ b/seediso/windows11/40-Install-Rustup.bat @@ -20,7 +20,7 @@ echo Downloading rustup-init (%RUSTUP_ARCH%)... curl.exe -L --fail -o "%INSTALLER%" https://win.rustup.rs/%RUSTUP_ARCH% if errorlevel 1 ( echo Download failed. - pause + if not defined INSTALL_ALL pause exit /b 1 ) @@ -35,5 +35,5 @@ if "%RC%"=="0" ( ) else ( echo rustup-init exited with code %RC%. ) -pause +if not defined INSTALL_ALL pause exit /b %RC% diff --git a/seediso/windows11/50-Install-NSIS-Admin.bat b/seediso/windows11/50-Install-NSIS-Admin.bat index 2b95856..d8c7acd 100644 --- a/seediso/windows11/50-Install-NSIS-Admin.bat +++ b/seediso/windows11/50-Install-NSIS-Admin.bat @@ -5,14 +5,14 @@ title Install NSIS fltmc >nul 2>&1 if errorlevel 1 ( echo Please right-click this file and choose "Run as administrator". - pause + if not defined INSTALL_ALL pause exit /b 1 ) where winget.exe >nul 2>&1 if errorlevel 1 ( echo winget was not found. - pause + if not defined INSTALL_ALL pause exit /b 1 ) @@ -28,5 +28,5 @@ if "%RC%"=="0" ( ) else ( echo winget exited with code %RC%. ) -pause +if not defined INSTALL_ALL pause exit /b %RC% diff --git a/seediso/windows11/60-Install-Qt6.bat b/seediso/windows11/60-Install-Qt6.bat index f8a12cd..e04a9de 100644 --- a/seediso/windows11/60-Install-Qt6.bat +++ b/seediso/windows11/60-Install-Qt6.bat @@ -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 if errorlevel 1 ( echo Download failed. - pause + if not defined INSTALL_ALL pause exit /b 1 ) @@ -41,5 +41,5 @@ if "%RC%"=="0" ( ) else ( echo aqt exited with code %RC%. ) -pause +if not defined INSTALL_ALL pause exit /b %RC% diff --git a/seediso/windows11/70-Install-ws2tcp-local-Admin.bat b/seediso/windows11/70-Install-ws2tcp-local-Admin.bat index ec86410..31720f9 100644 --- a/seediso/windows11/70-Install-ws2tcp-local-Admin.bat +++ b/seediso/windows11/70-Install-ws2tcp-local-Admin.bat @@ -5,7 +5,7 @@ title Install ws2tcp-local fltmc >nul 2>&1 if errorlevel 1 ( echo Please right-click this file and choose "Run as administrator". - pause + if not defined INSTALL_ALL pause 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" if not defined URL ( echo Could not read the download URL from %MANIFEST%. - pause + if not defined INSTALL_ALL pause exit /b 1 ) @@ -25,7 +25,7 @@ echo Downloading %URL%... curl.exe -fL --retry 3 -o "%INSTALLER%" "%URL%" if errorlevel 1 ( echo Download failed. - pause + if not defined INSTALL_ALL pause exit /b 1 ) @@ -40,7 +40,7 @@ if "%RC%"=="0" ( ) else ( echo The installer exited with code %RC%. ) -pause +if not defined INSTALL_ALL pause exit /b %RC% :desktop_shortcut