3 :: Fail early if environment not set
4 if not defined BUILD_VCVARSALL exit /b 1
5 if not defined BUILD_ARCHIVE_NAME exit /b 1
6 if not defined BUILD_PARALLEL_THREADS exit /b 1
7 if not defined BUILD_7ZIP exit /b 1
9 :: Clean and enter shadow build folder
12 if exist bin rmdir bin /s /q || goto :error
13 if exist ipch rmdir ipch /s /q || goto :error
14 if exist tmp rmdir tmp /s /q || goto :error
15 if exist build rmdir build /s /q || goto :error
16 mkdir build || goto :error
18 :: Unpack archived dependencies
19 echo Unpacking archived dependencies...
20 "%BUILD_7ZIP%" x -y -odependencies dependencies\cef.7z || goto :error
22 :: Setup VC++ environment
23 echo Setting up VC++...
24 call "%BUILD_VCVARSALL%" x86 || goto :error
28 msbuild /t:Clean /p:Configuration=Release || goto :error
29 msbuild /p:Configuration=Release /m:%BUILD_PARALLEL_THREADS% || goto :error
31 :: Create server folder to later zip
32 cd build || goto :error
33 set SERVER_FOLDER=CasparCG Server
34 if exist "%SERVER_FOLDER%" rmdir "%SERVER_FOLDER%" /s /q || goto :error
35 mkdir "%SERVER_FOLDER%" || goto :error
39 xcopy ..\deploy\Server "%SERVER_FOLDER%\Server" /E /I /Y || goto :error
40 xcopy ..\deploy\Wallpapers "%SERVER_FOLDER%\Wallpapers" /E /I /Y || goto :error
41 copy ..\deploy\CasparCG_Server_2.0-brochure.pdf "%SERVER_FOLDER%" || goto :error
44 echo Copying binaries...
45 copy ..\bin\Release\* "%SERVER_FOLDER%\Server" || goto :error
46 xcopy ..\bin\Release\locales "%SERVER_FOLDER%\Server\locales" /E /I /Y || goto :error
49 echo Copying documentation...
50 copy ..\CHANGES.txt "%SERVER_FOLDER%" || goto :error
51 copy ..\LICENSE.txt "%SERVER_FOLDER%" || goto :error
52 copy ..\README.txt "%SERVER_FOLDER%" || goto :error
56 "%BUILD_7ZIP%" a "%BUILD_ARCHIVE_NAME%.zip" "%SERVER_FOLDER%" || goto :error
58 :: Skip exiting with failure