3 @echo Setting environment for using Microsoft Visual Studio 2010 x86 tools.
5 @call :GetVSCommonToolsDir
6 @if "%VS100COMNTOOLS%"=="" goto error_no_VS100COMNTOOLSDIR
8 @call "%VS100COMNTOOLS%VCVarsQueryRegistry.bat" 32bit No64bit
10 @if "%VSINSTALLDIR%"=="" goto error_no_VSINSTALLDIR
11 @if "%FrameworkDir32%"=="" goto error_no_FrameworkDIR32
12 @if "%FrameworkVersion32%"=="" goto error_no_FrameworkVer32
13 @if "%Framework35Version%"=="" goto error_no_Framework35Version
15 @set FrameworkDir=%FrameworkDir32%
16 @set FrameworkVersion=%FrameworkVersion32%
18 @if not "%WindowsSdkDir%" == "" (
19 @set "PATH=%WindowsSdkDir%bin\NETFX 4.0 Tools;%WindowsSdkDir%bin;%PATH%"
20 @set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%"
21 @set "LIB=%WindowsSdkDir%lib;%LIB%"
25 @rem Root of Visual Studio IDE installed files.
27 @set DevEnvDir=%VSINSTALLDIR%Common7\IDE\
31 @if exist "%VSINSTALLDIR%Team Tools\Performance Tools" (
32 @set "PATH=%VSINSTALLDIR%Team Tools\Performance Tools;%PATH%"
34 @if exist "%ProgramFiles%\HTML Help Workshop" set PATH=%ProgramFiles%\HTML Help Workshop;%PATH%
35 @if exist "%ProgramFiles(x86)%\HTML Help Workshop" set PATH=%ProgramFiles(x86)%\HTML Help Workshop;%PATH%
36 @if exist "%VCINSTALLDIR%VCPackages" set PATH=%VCINSTALLDIR%VCPackages;%PATH%
37 @set PATH=%FrameworkDir%%Framework35Version%;%PATH%
38 @set PATH=%FrameworkDir%%FrameworkVersion%;%PATH%
39 @set PATH=%VSINSTALLDIR%Common7\Tools;%PATH%
40 @if exist "%VCINSTALLDIR%BIN" set PATH=%VCINSTALLDIR%BIN;%PATH%
41 @set PATH=%DevEnvDir%;%PATH%
43 @if exist "%VSINSTALLDIR%VSTSDB\Deploy" (
44 @set "PATH=%VSINSTALLDIR%VSTSDB\Deploy;%PATH%"
47 @if not "%FSHARPINSTALLDIR%" == "" (
48 @set "PATH=%FSHARPINSTALLDIR%;%PATH%"
53 @if exist "%VCINSTALLDIR%ATLMFC\INCLUDE" set INCLUDE=%VCINSTALLDIR%ATLMFC\INCLUDE;%INCLUDE%
54 @if exist "%VCINSTALLDIR%INCLUDE" set INCLUDE=%VCINSTALLDIR%INCLUDE;%INCLUDE%
58 @if exist "%VCINSTALLDIR%ATLMFC\LIB" set LIB=%VCINSTALLDIR%ATLMFC\LIB;%LIB%
59 @if exist "%VCINSTALLDIR%LIB" set LIB=%VCINSTALLDIR%LIB;%LIB%
63 @if exist "%VCINSTALLDIR%ATLMFC\LIB" set LIBPATH=%VCINSTALLDIR%ATLMFC\LIB;%LIBPATH%
64 @if exist "%VCINSTALLDIR%LIB" set LIBPATH=%VCINSTALLDIR%LIB;%LIBPATH%
65 @set LIBPATH=%FrameworkDir%%Framework35Version%;%LIBPATH%
66 @set LIBPATH=%FrameworkDir%%FrameworkVersion%;%LIBPATH%
70 @REM -----------------------------------------------------------------------
73 @call :GetVSCommonToolsDirHelper32 HKLM > nul 2>&1
74 @if errorlevel 1 call :GetVSCommonToolsDirHelper32 HKCU > nul 2>&1
75 @if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKLM > nul 2>&1
76 @if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKCU > nul 2>&1
79 :GetVSCommonToolsDirHelper32
80 @for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO (
82 @SET "VS100COMNTOOLS=%%k"
85 @if "%VS100COMNTOOLS%"=="" exit /B 1
86 @SET "VS100COMNTOOLS=%VS100COMNTOOLS%Common7\Tools\"
89 :GetVSCommonToolsDirHelper64
90 @for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO (
92 @SET "VS100COMNTOOLS=%%k"
95 @if "%VS100COMNTOOLS%"=="" exit /B 1
96 @SET "VS100COMNTOOLS=%VS100COMNTOOLS%Common7\Tools\"
99 @REM -----------------------------------------------------------------------
100 :error_no_VS100COMNTOOLSDIR
101 @echo ERROR: Cannot determine the location of the VS Common Tools folder.
104 :error_no_VSINSTALLDIR
105 @echo ERROR: Cannot determine the location of the VS installation.
108 :error_no_FrameworkDIR32
109 @echo ERROR: Cannot determine the location of the .NET Framework 32bit installation.
112 :error_no_FrameworkVer32
113 @echo ERROR: Cannot determine the version of the .NET Framework 32bit installation.
116 :error_no_Framework35Version
117 @echo ERROR: Cannot determine the .NET Framework 3.5 version.
122 msbuild msvc-2010.sln /p:Configuration=Release /target:clean
123 msbuild msvc-2010.sln /p:Configuration=Release