From 36b4a492587fda628adc9f335cdd53235ffffb12 Mon Sep 17 00:00:00 2001 From: CorpNewt <12772521+corpnewt@users.noreply.github.com> Date: Wed, 8 Jul 2020 12:31:58 -0500 Subject: [PATCH] Update MakeInstall.bat --- MakeInstall.bat | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MakeInstall.bat b/MakeInstall.bat index 21f0dbb..a019ede 100644 --- a/MakeInstall.bat +++ b/MakeInstall.bat @@ -48,16 +48,16 @@ goto checkpy :setcomspec REM Helper method to return the "proper" path to cmd.exe, reg.exe, and where.exe by walking the ComSpec var -REM Prep the LF variable to use the "line feed" approach - requires 2 newlines after it to function -set LF=^ - - +REM Prep the LF variable to use the "line feed" approach +(SET LF=^ +%=this line is empty=% +) REM Strip double semi-colons call :undouble "ComSpec" ";" set "testpath=%ComSpec:;=!LF!%" REM Let's walk each path and test if cmd.exe, reg.exe, and where.exe exist there set /a found=0 -for /f %%i in ("!testpath!") do ( +for /f "tokens=* delims=" %%i in ("!testpath!") do ( REM Only continue if we haven't found it yet if NOT "%%i" == "" ( if !found! lss 1 ( @@ -103,7 +103,7 @@ REM Remove double semicolons from the adjusted PATH call :undouble "PATH" ";" goto :EOF -:undouble - string_name character +:undouble REM Helper function to strip doubles of a single character out of a string recursively set "string_name=%~1" set "character=%~2" @@ -164,7 +164,7 @@ if "!pypath!" == "" ( ) goto runscript -:checkpyversion - path py2v py2path py3v py3path +:checkpyversion set "version="&for /f "tokens=2* USEBACKQ delims= " %%a in (`"%~1" -V 2^>^&1`) do ( REM Ensure we have a version number call :isnumber "%%a" @@ -189,12 +189,12 @@ if "!version:~0,1!" == "2" ( ) goto :EOF -:isnumber - check_value +:isnumber set "var="&for /f "delims=0123456789." %%i in ("%~1") do set var=%%i if defined var (exit /b 1) exit /b 0 -:comparepyversion - version1 version2 return +:comparepyversion REM Exits with status 0 if equal, 1 if v1 gtr v2, 2 if v1 lss v2 for /f "tokens=1,2,3 delims=." %%a in ("%~1") do ( set a1=%%a