Commit 220cd241 authored by Jay Satiro's avatar Jay Satiro
Browse files

projects: Improve Windows perl detection in batch scripts

- Determine if perl is in the user's PATH by running perl.exe.

Prior to this change detection was done by checking the PATH for perl/
but that did not work in all cases (eg git install includes perl but
not in perl/ path).

Bug: https://github.com/curl/curl/pull/2865
Reported-by: Daniel Jeliński
parent b676b66f
Loading
Loading
Loading
Loading
+14 −19
Original line number Diff line number Diff line
@@ -153,11 +153,9 @@ rem ***************************************************************************
  rem Check we have Visual Studio installed
  if not exist "%ABS_VC_PATH%" goto novc

  
  if not defined PERL_PATH (
    rem Check we have Perl in our path
	rem using !! below as %% was having \Microsoft was unexpected error.
	echo !PATH! | findstr /I /C:"\Perl" 1>nul
    perl --version <NUL 1>NUL 2>&1
    if errorlevel 1 (
      rem It isn't so check we have it installed and set the path if it is
      if exist "%SystemDrive%\Perl" (
@@ -166,9 +164,6 @@ rem ***************************************************************************
        if exist "%SystemDrive%\Perl64" (
          set "PATH=%SystemDrive%\Perl64\bin;%PATH%"
        ) else (



          goto noperl
        )
      )
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ rem ***************************************************************************

:prerequisites
  rem Check we have Perl in our path
  echo %PATH% | findstr /I /C:"\Perl" 1>nul
  perl --version <NUL 1>NUL 2>&1
  if errorlevel 1 (
    rem It isn't so check we have it installed and set the path if it is
    if exist "%SystemDrive%\Perl" (