forked from CosmosOS/Cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-VS2017.bat
38 lines (27 loc) · 1.21 KB
/
install-VS2017.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@echo off
set DOTNET_VERSION=4.7.1
echo Check for installed .NET Framework %DOTNET_VERSION%
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v%DOTNET_VERSION%" /ve >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo ".NET Framework %DOTNET_VERSION% is not installed. Please download it from https://www.microsoft.com/net/download/visual-studio-sdks"
pause
goto:eof
)
if not exist "%ProgramFiles(x86)%" (
set "ProgramFiles(x86)=%ProgramFiles%"
)
set "VSWhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
:MSBuild
echo Looking for MSBuild
for /f "usebackq delims=" %%i in (`^""%VSWhere%" -latest -version "[15.0,16.0)" -products * -requires "Microsoft.Component.MSBuild" -property "installationPath"^"`) do (
set InstallDir=%%i
)
set "MSBuild=%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"
if not exist "%MSBuild%" (
echo MSBuild not found. Please make sure Visual Studio 15.2+ is installed.
pause
goto:eof
)
echo Building Builder.sln
"%MSBuild%" Builder.sln /nologo /maxcpucount /nodeReuse:false /verbosity:minimal /t:Restore;Build
start "Cosmos Builder" "source\Cosmos.Build.Builder\bin\Debug\net471\Cosmos.Build.Builder.exe" "-VSPATH=%InstallDir%" %*