anchor.diff:  	return nil
   end
   
  +local function get_visual_studio_directory_from_vswhere()
  +	assert(type(vars.LUA_RUNTIME)=="string", "requires vars.LUA_RUNTIME to be set before calling this function.")
  +	local major, minor = vars.LUA_RUNTIME:match('VCR%u*(%d+)(%d)$')
  +	if not major then
  +		print(S[[    Cannot auto-detect Visual Studio version from $LUA_RUNTIME]])
  +		return nil
  +	end
  +	if tonumber(major) < 14 then
  +		return nil
  +	end
  +	local program_dir = os.getenv('PROGRAMFILES(X86)')
  +	if not program_dir then
  +		return nil
  +	end
  +	local vswhere = program_dir.."\\Microsoft Visual Studio\\Installer\\vswhere.exe"
  +	if not exists(vswhere) then
  +		return nil
  +	end
  +	local f, msg = io.popen('"'..vswhere..'" -products * -property installationPath')
  +	if not f then return nil, "failed to run vswhere: "..msg end
  +	local vsdir = nil
  +	while true do
  +		local l, err = f:read()
  +		if not l then
  +			if err then
  +				f:close()
  +				return nil, err
  +			else
  +				break
  +			end
  +		end
  +		vsdir = l
  +	end
  +	f:close()
  +	if not vsdir then
  +		return nil
  +	end
  +	print("    Visual Studio 2017 or higher found in: "..vsdir)
  +	return vsdir
  +end
  +
   local function get_windows_sdk_directory()
   	assert(type(vars.LUA_RUNTIME) == "string", "requires vars.LUA_RUNTIME to be set before calling this function.")
   	-- Only v7.1 and v6.1 shipped with compilers
  
positive.code: 		end
  	end
  
  	-- 2. try for Windows SDKs command line tools.
  	local wsdkdir = get_windows_sdk_directory()
  	if wsdkdir then
  		local setenv = wsdkdir.."Bin\\SetEnv.cmd"
  
negative.code: 	return nil
  end
  
  local function get_visual_studio_directory_from_registry()
  	assert(type(vars.LUA_RUNTIME)=="string", "requires vars.LUA_RUNTIME to be set before calling this function.")
  	local major, minor = vars.LUA_RUNTIME:match('VCR%u*(%d+)(%d)$') -- MSVCR<x><y> or VCRUNTIME<x><y>
  	if not major then 
  