setlocal

set IDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
set BUILD_PATH=C:\Windows\Microsoft.NET\Framework64\v4.0.30319

"%IDE_PATH%\devenv" /build Release ..\Windows\FooEditEngine.sln
if errorlevel 1 goto end
"%IDE_PATH%\devenv" /build Release ..\WPF\FooEditEngine.sln
if errorlevel 1 goto end
"%IDE_PATH%\devenv" /build Release ..\Metro\Test.sln
if errorlevel 1 goto end
"%BUILD_PATH%\MSBuild.exe" /p:Configuration=Release ..\Help\fooeditengine_api.shfbproj
if errorlevel 1 goto end

md dist
copy ..\Help\Help\Documentation.chm dist
md dist\winform
copy ..\Windows\FooEditEngine\bin\Release\*.dll dist\winform
md dist\wpf
copy ..\WPF\FooEditEngine\bin\Release\*.dll dist\wpf
md dist\metro
copy ..\Metro\FooEditEngine\bin\Release\*.dll dist\metro
copy ..\Metro\FooEditEngine\bin\Release\*.pri dist\metro
md dist\metro\FooEditEngine.Metro\Themes
copy ..\Metro\FooEditEngine\bin\Release\*.xr.xml dist\metro\FooEditEngine.Metro
copy ..\Metro\FooEditEngine\bin\Release\Themes\*.* dist\metro\FooEditEngine.Metro\Themes

:end
endlocal
pause
