Files
GuofangandClaude Sonnet 5.5 428d99108b Download aqtinstall through the wangguofang.net GitHub proxy
Also update vm-images: download Win32-OpenSSH through the same proxy.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 09:28:34 +08:00

46 lines
1.4 KiB
Batchfile

@echo off
setlocal
title Install Qt 6
rem Qt is not available from winget, so this uses the standalone aqtinstall (aqt) to fetch it.
rem The msvc2022 builds need the MSVC Build Tools (see 20-Install-MSVC-Admin.bat).
set "QT_VERSION=6.10.3"
set "QT_ROOT=C:\Qt"
set "AQT=%TEMP%\aqt.exe"
rem PROCESSOR_ARCHITEW6432 holds the real architecture when this runs under emulation.
set "ARCH=%PROCESSOR_ARCHITECTURE%"
if defined PROCESSOR_ARCHITEW6432 set "ARCH=%PROCESSOR_ARCHITEW6432%"
if /i "%ARCH%"=="ARM64" (
set "QT_HOST=windows_arm64"
set "QT_DIR=msvc2022_arm64"
) else (
set "QT_HOST=windows"
set "QT_DIR=msvc2022_64"
)
set "QT_ARCH=win64_%QT_DIR%"
rem aqt has no Arm64 build; the x64 one runs under emulation on Arm64 Windows.
echo Downloading aqtinstall...
curl.exe -L --fail -o "%AQT%" https://wangguofang.net/github.com/miurahr/aqtinstall/releases/download/v3.3.0/aqt_x64.exe
if errorlevel 1 (
echo Download failed.
if not defined INSTALL_ALL pause
exit /b 1
)
echo Installing Qt %QT_VERSION% (%QT_ARCH%) to %QT_ROOT% ...
"%AQT%" install-qt %QT_HOST% desktop %QT_VERSION% %QT_ARCH% --outputdir "%QT_ROOT%"
set "RC=%ERRORLEVEL%"
del "%AQT%" >nul 2>&1
if "%RC%"=="0" (
echo Done. Use -DCMAKE_PREFIX_PATH=%QT_ROOT%\%QT_VERSION%\%QT_DIR% with CMake.
) else (
echo aqt exited with code %RC%.
)
if not defined INSTALL_ALL pause
exit /b %RC%