--- /dev/null
+@echo off\r
+setlocal\r
+set D=%~dp0\r
+set PCBUILD=%D%..\..\PCBuild\\r
+\r
+set BUILDX86=\r
+set BUILDX64=\r
+set REBUILD=\r
+set OUTPUT=\r
+set PACKAGES=\r
+\r
+:CheckOpts\r
+if "%~1" EQU "-h" goto Help\r
+if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts\r
+if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts\r
+if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts\r
+if "%~1" EQU "-o" (set OUTPUT="/p:OutputPath=%~2") && shift && shift && goto CheckOpts\r
+if "%~1" EQU "--out" (set OUTPUT="/p:OutputPath=%~2") && shift && shift && goto CheckOpts\r
+if "%~1" EQU "-p" (set PACKAGES=%PACKAGES% %~2) && shift && shift && goto CheckOpts\r
+\r
+if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)\r
+\r
+call "%D%..\msi\get_externals.bat"\r
+call "%PCBUILD%env.bat" x86\r
+\r
+if defined PACKAGES set PACKAGES="/p:Packages=%PACKAGES%"\r
+\r
+if defined BUILDX86 (\r
+ if defined REBUILD ( call "%PCBUILD%build.bat" -e -r\r
+ ) else if not exist "%PCBUILD%win32\python.exe" call "%PCBUILD%build.bat" -e\r
+ if errorlevel 1 goto :eof\r
+\r
+ msbuild "%D%make_pkg.proj" /p:Configuration=Release /p:Platform=x86 %OUTPUT% %PACKAGES%\r
+ if errorlevel 1 goto :eof\r
+)\r
+\r
+if defined BUILDX64 (\r
+ if defined REBUILD ( call "%PCBUILD%build.bat" -p x64 -e -r\r
+ ) else if not exist "%PCBUILD%amd64\python.exe" call "%PCBUILD%build.bat" -p x64 -e\r
+ if errorlevel 1 goto :eof\r
+\r
+ msbuild "%D%make_pkg.proj" /p:Configuration=Release /p:Platform=x64 %OUTPUT% %PACKAGES%\r
+ if errorlevel 1 goto :eof\r
+)\r
+\r
+exit /B 0\r
+\r
+:Help\r
+echo build.bat [-x86] [-x64] [--out DIR] [-r] [-h]\r
+echo.\r
+echo -x86 Build x86 installers\r
+echo -x64 Build x64 installers\r
+echo -r Rebuild rather than incremental build\r
+echo --out [DIR] Override output directory\r
+echo -h Show usage\r