-
Notifications
You must be signed in to change notification settings - Fork 6
/
DevEnv_Wrapper_VS2017.bat
53 lines (39 loc) · 2.65 KB
/
DevEnv_Wrapper_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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@SETLOCAL
@REM
@ECHO OFF
SET scriptName=%~nx0
ECHO Start %scriptName%
SET invokePath=%~dp0.
@REM The CALL preserves quotes for ~dp0. Prevents problems "Extra quotes inside a path" if this file invoked with a path with quotes.
SET invokePath=%invokePath:"=%
CALL "%invokePath%\util\set-environment.bat"
CALL %env_qUtil%\exit_if_error
CALL "%invokePath%\set-manager-environment.bat"
CALL %env_qUtil%\exit_if_error
REM The following prevents build-machines (Jenkins) from locking (freezing) and a crash at the end of a build.
REM https://stackoverflow.com/questions/7916687/error-msb4166-child-node-exited-prematurely-shutting-down
REM https://techdocs.ed-fi.org/display/ODSAPI20/Step+4.+Prepare+the+Development+Environment
REM We can use "-nodeReuse:False" with "-maxCpuCount" on a MSBuild call but it is possible to use "SET MSBUILDDISABLENODEREUSE=1" globally to do the same.
SET MSBUILDDISABLENODEREUSE=1
@REM Uncomment the following workarounds as needed.
REM CALL %env_qManager%\workaround\DevEnv-Vdproj-VS2017_Professional-HRESULT-8000000A-EnableOutOfProcBuild.bat
CALL %env_qManager%\workaround\MSBuild-File-System-Redirector-fail-System32-to-SysWOW64.bat
REM CALL %env_qManager%\workaround\MSBuild-Unable-to-create-Temp-directory.bat
ECHO Prepare the development environment.
@REM We need to invoke the exact preparation script here because after migration from VS2010 to VS2015 we got a broken environment on our Build-Server. It is actual for VS2017 too.
@REM and we are getting the empty SDK40ToolsPath.
@REM MSB3086 Microsoft.Common.targets Task could not find "sgen.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed
@REM http://stackoverflow.com/questions/2731365/running-msbuild-fails-to-read-sdktoolspath
@REM http://stackoverflow.com/questions/34045326/msbuild-sgen-exe-is-missing
@REM http://stackoverflow.com/questions/26442450/why-is-visual-studio-2013-using-the-wrong-sdktoolspath-for-lc-exe
@REM
ECHO CALL %env_vs2017_dev_cmd%
CALL %env_vs2017_dev_cmd%
CALL %env_qUtil%\exit_if_error
@REM We have to use exactly the "DevEnv.COM" wrapper of the VS IDE "DevEnv.EXE". There are some troubles with "DevEnv.EXE".
@REM So, here we explicitly prevent cases where ".COM" not the first value at the PATHEXT environment variable.
@REM Example of the problem - PATHEXT: ".EXE;.COM;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
ECHO CALL DevEnv.COM %*
CALL DevEnv.COM %*
CALL %env_qUtil%\exit_if_error
ECHO End %scriptName%