| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,20 +32,13 @@ | |||
| 32 | 32 | @rem VS 2017 and later provide vswhere.exe, which can be used | |
| 33 | 33 | @if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" goto :skip_vswhere | |
| 34 | 34 | @set _Py_MSBuild_Root= | |
| 35 | - @for /F "tokens=*" %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest') DO @(set _Py_MSBuild_Root=%%i\MSBuild) | ||
| 35 | + @for /F "tokens=*" %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64') DO @(set _Py_MSBuild_Root=%%i\MSBuild) | ||
| 36 | 36 | @if not defined _Py_MSBuild_Root goto :skip_vswhere | |
| 37 | 37 | @for %%j in (Current 15.0) DO @if exist "%_Py_MSBuild_Root%\%%j\Bin\msbuild.exe" (set MSBUILD="%_Py_MSBuild_Root%\%%j\Bin\msbuild.exe") | |
| 38 | 38 | @set _Py_MSBuild_Root= | |
| 39 | 39 | @if defined MSBUILD @if exist %MSBUILD% (set _Py_MSBuild_Source=Visual Studio installation) & goto :found | |
| 40 | 40 | :skip_vswhere | |
| 41 | 41 | ||
| 42 | - @rem VS 2017 sets exactly one install as the "main" install, so we may find MSBuild in there. | ||
| 43 | - @reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v 15.0 /reg:32 >nul 2>nul | ||
| 44 | - @if NOT ERRORLEVEL 1 @for /F "tokens=1,2*" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v 15.0 /reg:32') DO @( | ||
| 45 | - @if "%%i"=="15.0" @if exist "%%k\MSBuild\15.0\Bin\msbuild.exe" @(set MSBUILD="%%k\MSBuild\15.0\Bin\msbuild.exe") | ||
| 46 | - ) | ||
| 47 | - @if exist %MSBUILD% (set _Py_MSBuild_Source=Visual Studio 2017 registry) & goto :found | ||
| 48 | - | ||
| 49 | 42 | @rem VS 2015 and earlier register MSBuild separately, so we can find it. | |
| 50 | 43 | @reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath /reg:32 >nul 2>nul | |
| 51 | 44 | @if NOT ERRORLEVEL 1 @for /F "tokens=1,2*" %%i in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath /reg:32') DO @( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -195,23 +195,41 @@ public override bool Execute() { | |||
| 195 | 195 | </Target> | |
| 196 | 196 | ||
| 197 | 197 | ||
| 198 | - <Target Name="FindVCRuntime" Returns="VCRuntimeDLL"> | ||
| 199 | - <PropertyGroup Condition="$(PlatformToolset) != 'v140'"> | ||
| 200 | - <VCRedistDir>$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir> | ||
| 201 | - <VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir> | ||
| 202 | - <VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir> | ||
| 203 | - </PropertyGroup> | ||
| 198 | + <Target Name="FindVCRedistDir"> | ||
| 199 | + <!-- Hard coded path for VS 2015 --> | ||
| 204 | 200 | <PropertyGroup Condition="$(PlatformToolset) == 'v140'"> | |
| 205 | 201 | <VCRedistDir>$(VCInstallDir)\redist\</VCRedistDir> | |
| 202 | + </PropertyGroup> | ||
| 203 | + | ||
| 204 | + <!-- Search for version number in some broken Build Tools installs --> | ||
| 205 | + <ItemGroup Condition="$(VCRedistDir) == '' and $(VCToolsRedistVersion) == ''"> | ||
| 206 | + <_RedistFiles Include="$(VCInstallDir)\Redist\MSVC\*\*.*" /> | ||
| 207 | + </ItemGroup> | ||
| 208 | + <PropertyGroup Condition="$(VCRedistDir) == '' and $(VCToolsRedistVersion) == ''"> | ||
| 209 | + <_RedistDir>%(_RedistFiles.Directory)</_RedistDir> | ||
| 210 | + <VCToolsRedistVersion>$([System.IO.Path]::GetFileName($(_RedistDir.Trim(`\`))))</VCToolsRedistVersion> | ||
| 211 | + </PropertyGroup> | ||
| 212 | + | ||
| 213 | + <!-- Use correct path for VS 2017 and later --> | ||
| 214 | + <PropertyGroup Condition="$(VCRedistDir) == ''"> | ||
| 215 | + <VCRedistDir>$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir> | ||
| 216 | + </PropertyGroup> | ||
| 217 | + | ||
| 218 | + <PropertyGroup> | ||
| 206 | 219 | <VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir> | |
| 207 | 220 | <VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir> | |
| 208 | 221 | </PropertyGroup> | |
| 209 | 222 | ||
| 223 | + <Message Text="VC Redist Directory: $(VCRedistDir)" /> | ||
| 224 | + <Message Text="VC Redist Version: $(VCToolsRedistVersion)" /> | ||
| 225 | + </Target> | ||
| 226 | + | ||
| 227 | + <Target Name="FindVCRuntime" Returns="VCRuntimeDLL" DependsOnTargets="FindVCRedistDir"> | ||
| 210 | 228 | <ItemGroup Condition="$(VCInstallDir) != ''"> | |
| 211 | 229 | <VCRuntimeDLL Include="$(VCRedistDir)\Microsoft.VC*.CRT\vcruntime*.dll" /> | |
| 212 | 230 | </ItemGroup> | |
| 213 | 231 | ||
| 214 | - <Warning Text="vcruntime14*.dll not found under $(VCInstallDir)" Condition="@(VCRuntimeDLL) == ''" /> | ||
| 215 | - <Message Text="VCRuntimeDLL: @(VCRuntimeDLL)" Importance="high" /> | ||
| 232 | + <Warning Text="vcruntime*.dll not found under $(VCRedistDir)." Condition="@(VCRuntimeDLL) == ''" /> | ||
| 233 | + <Message Text="VC Runtime DLL(s):%0A- @(VCRuntimeDLL,'%0A- ')" /> | ||
| 216 | 234 | </Target> | |
| 217 | 235 | </Project> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments