@@ -127,10 +127,19 @@ goto next-arg
127127
128128:args-done
129129
130+ REM Shortcut for just linting (does not need python)
130131if " %* " == " lint" (
131132 goto lint-cpp
132133)
133134
135+ REM Make sure we can find python
136+ call :run-python --version > NUL
137+ if errorlevel 1 (
138+ echo Could not find python2. More information can be found at
139+ echo https://github.com/nodejs/node/blob/master/BUILDING.md#windows-1
140+ exit /b 1
141+ )
142+
134143if defined build_release (
135144 set config = Release
136145 set package = 1
@@ -172,8 +181,6 @@ if "%target%"=="Clean" echo deleting %~dp0deps\icu
172181if " %target% " == " Clean" rmdir /S /Q %~dp0 deps\icu
173182:no-depsicu
174183
175- call :getnodeversion || exit /b 1
176-
177184if " %target% " == " Clean" rmdir /Q /S " %~dp0 %config% \node-v%FULLVERSION% -win-%target_arch% " > nul 2 > nul
178185
179186if defined noprojgen if defined nobuild if not defined sign if not defined msi goto licensertf
@@ -354,6 +361,7 @@ if not defined msi goto run
354361
355362:msibuild
356363echo Building node-v%FULLVERSION% -%target_arch% .msi
364+ call :getnodeversion || exit /b 1
357365msbuild " %~dp0 tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:PlatformToolset=%PLATFORM_TOOLSET% /p:GypMsvsVersion=%GYP_MSVS_VERSION% /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% %noetw_msi_arg% %noperfctr_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
358366if errorlevel 1 goto exit
359367
@@ -556,8 +564,13 @@ echo vcbuild.bat lint : runs the C++ and JavaScript linter
556564goto exit
557565
558566:run-python
559- call tools\msvs\find_python.cmd
560- if errorlevel 1 echo Could not find python2 & goto :exit
567+ IF NOT DEFINED DEBUG_HELPER (
568+ call tools\msvs\find_python.cmd 1 > NUL 2 >& 1
569+ ) ELSE (
570+ call tools\msvs\find_python.cmd
571+ )
572+ if errorlevel 1 exit /b 1
573+
561574set cmd1 = " %VCBUILD_PYTHON_LOCATION% " %*
562575echo %cmd1%
563576%cmd1%
@@ -575,8 +588,6 @@ rem ***************
575588set NODE_VERSION =
576589set TAG =
577590set FULLVERSION =
578- :: Call as subroutine for validation of python
579- call :run-python tools\getnodeversion.py > nul
580591for /F " tokens=*" %%i in ('" %VCBUILD_PYTHON_LOCATION% " tools\getnodeversion.py') do set NODE_VERSION = %%i
581592if not defined NODE_VERSION (
582593 echo Cannot determine current version of Node.js
0 commit comments