installer_windows.cmd 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. @ECHO OFF
  2. REM
  3. REM Copyright (c) Contributors to the Open 3D Engine Project.
  4. REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. REM
  6. REM SPDX-License-Identifier: Apache-2.0 OR MIT
  7. REM
  8. REM
  9. SETLOCAL EnableDelayedExpansion
  10. CALL %~dp0env_windows.cmd
  11. IF NOT EXIST %OUTPUT_DIRECTORY% (
  12. ECHO [ci_build] Error: $OUTPUT_DIRECTORY was not found
  13. GOTO :error
  14. )
  15. PUSHD %OUTPUT_DIRECTORY%
  16. REM Make sure we are using the CMake version of CPack and not the one that comes with chocolatey
  17. SET CPACK_PATH=
  18. IF "%LY_CMAKE_PATH%"=="" (
  19. REM quote the paths from 'where' so we can properly tokenize ones in the list with spaces
  20. FOR /F delims^=^"^ tokens^=1 %%i in ('where /F cpack') DO (
  21. REM The cpack in chocolatey expects a number supplied with --version so it will error
  22. "%%i" --version > NUL
  23. IF !ERRORLEVEL!==0 (
  24. SET "CPACK_PATH=%%i"
  25. GOTO :run_cpack
  26. )
  27. )
  28. ) ELSE (
  29. SET "CPACK_PATH=%LY_CMAKE_PATH%\cpack.exe"
  30. )
  31. :run_cpack
  32. ECHO [ci_build] "!CPACK_PATH!" --version
  33. "!CPACK_PATH!" --version
  34. IF ERRORLEVEL 1 (
  35. ECHO [ci_build] CPack not found!
  36. GOTO :popd_error
  37. )
  38. ECHO [ci_build] "!CPACK_PATH!" -C %CONFIGURATION% %CPACK_OPTIONS%
  39. "!CPACK_PATH!" -C %CONFIGURATION% %CPACK_OPTIONS%
  40. IF NOT %ERRORLEVEL%==0 (
  41. REM dump the log file generated by cpack specifically for WIX
  42. ECHO ****************************************************************
  43. TYPE "_CPack_Packages\\WIX\\wix.log"
  44. ECHO ****************************************************************
  45. GOTO :popd_error
  46. )
  47. POPD
  48. EXIT /b 0
  49. :popd_error
  50. POPD
  51. :error
  52. EXIT /b 1