+if %PROCESSOR_ARCHITECTURE%==x86 (
+ set ProgramFilesPath_x86=%ProgramFiles%
+ echo "Architecture found = x86"
+) else (
+ set "ProgramFilesPath_x86=%ProgramFiles(x86)%"
+ echo "Architecture found = x64"
+)
+set compilerVersion="Visual Studio 10"
+set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
+if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
+if not exist %vcvarsall% (
+ set compilerVersion="Visual Studio 9 2008"
+ set vcvarsall="%ProgramFilesPath_x86%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
+ if not exist %vcvarsall% set vcvarsall="%ProgramFilesPath_x64%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
+ if not exist %vcvarsall% (
+ echo ERROR!!! Visual Studio has not been found in the system
+ exit
+ )
+)
+
+call %vcvarsall%
+