From e0c0b119d9468f10a4e4745242be3a0fc24a074d Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Fri, 12 Apr 2024 15:13:50 +0800 Subject: [PATCH] Tools/fsi.bat: add error handling Otherwise we would get the following error when running configure.bat in geewallet (after submodule population): ``` '""' is not recognized as an internal or external command, operable program or batch file. ``` --- Tools/fsi.bat | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Tools/fsi.bat b/Tools/fsi.bat index 71cdda6e..79bcccdb 100644 --- a/Tools/fsi.bat +++ b/Tools/fsi.bat @@ -1,5 +1,24 @@ @ECHO OFF -FOR /f "tokens=* delims=" %%A in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Component.FSharp -find **\fsi.exe') do set RUNNER=%%A +SET "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +SET "INSTALL_MSG=Please install .NET v6, or higher; or Visual Studio." + +ECHO checking for '%VSWHERE%'... +IF NOT EXIST "%VSWHERE%" ( + echo: + echo Tool vswhere.exe not found. + echo %INSTALL_MSG% + exit /b 1 +) + +ECHO checking for fsi.exe... +FOR /f "tokens=* delims=" %%A in ('"%VSWHERE%" -latest -requires Microsoft.VisualStudio.Component.FSharp -find **\fsi.exe') do set RUNNER=%%A + +IF "%RUNNER%"=="" ( + echo: + echo F# not found. + echo %INSTALL_MSG% + exit /b 1 +) "%RUNNER%" --define:LEGACY_FRAMEWORK %*