From 10440fdd1819f7f3aa3a2e48d39e669947a40d21 Mon Sep 17 00:00:00 2001 From: Brian Ingenito <28159742+bingenito@users.noreply.github.com> Date: Fri, 6 Nov 2020 16:18:36 -0500 Subject: [PATCH] build: conditionally clear vcinstalldir For scenario where target env is explicitly specified as vs2019, do not clear VCINSTALLDIR which was being cleared to handle fallback to vs2017 block when attempting to find a matching available VS. Fixes: https://github.com/nodejs/node/issues/35856 PR-URL: https://github.com/nodejs/node/pull/36009 Reviewed-By: Richard Lau Reviewed-By: Rich Trott --- vcbuild.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcbuild.bat b/vcbuild.bat index 292e05a93f83d7..7b730523dc2e00 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -248,7 +248,7 @@ echo Looking for Visual Studio 2019 @rem VCINSTALLDIR may be set if run from a VS Command Prompt and needs to be @rem cleared first as vswhere_usability_wrapper.cmd doesn't when it fails to @rem detect the version searched for -set "VCINSTALLDIR=" +if not defined target_env set "VCINSTALLDIR=" call tools\msvs\vswhere_usability_wrapper.cmd "[16.0,17.0)" if "_%VCINSTALLDIR%_" == "__" goto vs-set-2017 set "WIXSDKDIR=%WIX%\SDK\VS2017"