Skip to content

Commit 9316bfa

Browse files
committed
update setup.bat
1 parent ad616c1 commit 9316bfa

1 file changed

Lines changed: 34 additions & 44 deletions

File tree

examples/MCP/setup.bat

Lines changed: 34 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@REM SPDX-License-Identifier: BSD-3-Clause
33

44
@echo off
5+
setlocal enabledelayedexpansion
56

67
set SCRIPT_DIR=%~dp0
78
pushd "%SCRIPT_DIR%\..\.."
@@ -10,70 +11,59 @@ popd
1011

1112
set ARCH=%1
1213
if "%ARCH%"=="" (
13-
if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
14-
set ARCH=ARM64
15-
) else (
16-
set ARCH=x64
17-
)
14+
if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (set ARCH=ARM64) else (set ARCH=x64)
1815
)
1916

20-
@REM On ARM64, the cryptography package (required by fastmcp) must be compiled
21-
@REM from source. This requires OpenSSL development headers. Check early.
2217
if /i "%ARCH%"=="ARM64" (
2318
if "%OPENSSL_DIR%"=="" set OPENSSL_DIR=C:\Program Files\OpenSSL-Win64-ARM
19+
)
2420

25-
if not exist "%OPENSSL_DIR%\include" (
26-
echo OpenSSL not found. Downloading and installing...
27-
set OPENSSL_MSI=%TEMP%\Win64ARMOpenSSL-4_0_1.msi
28-
curl -L -o "%OPENSSL_MSI%" https://slproweb.com/download/Win64ARMOpenSSL-4_0_1.msi
29-
if errorlevel 1 (
30-
echo.
31-
echo ERROR: Failed to download OpenSSL installer.
32-
echo Check your internet connection and try again, or download manually:
33-
echo https://slproweb.com/download/Win64ARMOpenSSL-4_0_1.msi
34-
echo Install it, then re-run setup.bat
35-
echo.
36-
exit /b 1
37-
)
38-
msiexec /i "%OPENSSL_MSI%" /quiet /norestart INSTALLDIR="%OPENSSL_DIR%"
39-
if errorlevel 1 (
40-
echo.
41-
echo ERROR: OpenSSL installation failed.
42-
echo Try installing manually from:
43-
echo https://slproweb.com/download/Win64ARMOpenSSL-4_0_1.msi
44-
echo Then re-run setup.bat
45-
echo.
46-
exit /b 1
47-
)
48-
echo OpenSSL installed to %OPENSSL_DIR%
21+
if /i "%ARCH%"=="ARM64" if not exist "!OPENSSL_DIR!\include" (
22+
echo OpenSSL not found. Downloading and installing...
23+
curl -L -o "%TEMP%\Win64ARMOpenSSL.msi" https://slproweb.com/download/Win64ARMOpenSSL-4_0_1.msi
24+
if errorlevel 1 (
25+
echo.
26+
echo ERROR: Download failed. Install manually from:
27+
echo https://slproweb.com/download/Win64ARMOpenSSL-4_0_1.msi
28+
echo Then re-run setup.bat
29+
echo.
30+
exit /b 1
31+
)
32+
msiexec /i "%TEMP%\Win64ARMOpenSSL.msi" /quiet /norestart INSTALLDIR="!OPENSSL_DIR!"
33+
if errorlevel 1 (
34+
echo.
35+
echo ERROR: OpenSSL installation failed. Install manually from:
36+
echo https://slproweb.com/download/Win64ARMOpenSSL-4_0_1.msi
37+
echo Then re-run setup.bat
38+
echo.
39+
exit /b 1
4940
)
41+
echo OpenSSL installed to !OPENSSL_DIR!
42+
)
5043

51-
if not exist "%OPENSSL_DIR%\include" (
44+
if /i "%ARCH%"=="ARM64" (
45+
if not exist "!OPENSSL_DIR!\include" (
5246
echo.
53-
echo ERROR: OpenSSL headers still not found at %OPENSSL_DIR%\include
54-
echo Installation may have used a different path.
55-
echo Set OPENSSL_DIR manually and re-run:
47+
echo ERROR: OpenSSL headers not found at !OPENSSL_DIR!\include
48+
echo Set OPENSSL_DIR to the full installer path and re-run:
5649
echo setx OPENSSL_DIR "C:\Program Files\OpenSSL-Win64-ARM"
5750
echo.
5851
exit /b 1
5952
)
60-
61-
set OPENSSL_LIB_DIR=%OPENSSL_DIR%\lib\VC\arm64\MD
62-
if not exist "%OPENSSL_LIB_DIR%" (
53+
if not exist "!OPENSSL_DIR!\lib\VC\arm64\MD" (
6354
echo.
64-
echo ERROR: OpenSSL lib directory not found at %OPENSSL_LIB_DIR%
65-
echo Expected layout from the full ARM64 installer. Try reinstalling from:
55+
echo ERROR: OpenSSL libs not found at !OPENSSL_DIR!\lib\VC\arm64\MD
56+
echo Reinstall using the full installer ^(not Light^):
6657
echo https://slproweb.com/download/Win64ARMOpenSSL-4_0_1.msi
6758
echo.
6859
exit /b 1
6960
)
70-
71-
echo OpenSSL : %OPENSSL_DIR% [OK]
72-
echo OpenSSL libs : %OPENSSL_LIB_DIR% [OK]
61+
set OPENSSL_LIB_DIR=!OPENSSL_DIR!\lib\VC\arm64\MD
62+
echo OpenSSL : !OPENSSL_DIR! [OK]
63+
echo OpenSSL libs : !OPENSSL_LIB_DIR! [OK]
7364
)
7465

7566
set BUILD_DIR=%REPO_ROOT%\__Builds
76-
7767
if not exist "%BUILD_DIR%" (
7868
echo [1/3] Build not found. Running root build...
7969
call "%REPO_ROOT%\build.bat" %ARCH%

0 commit comments

Comments
 (0)