get_ps_servers.bat 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. @Rem Copyright Epic Games, Inc. All Rights Reserved.
  2. @echo off
  3. @Rem Set script location as working directory for commands.
  4. pushd "%~dp0"
  5. :arg_loop_start
  6. SET ARG=%1
  7. if DEFINED ARG (
  8. if "%ARG%"=="/h" (
  9. goto print_help
  10. )
  11. if "%ARG%"=="/v" (
  12. SET UEVersion=%2
  13. SHIFT
  14. )
  15. if "%ARG%"=="/b" (
  16. SET PSInfraTagOrBranch=%2
  17. SET IsTag=0
  18. SHIFT
  19. )
  20. if "%ARG%"=="/t" (
  21. SET PSInfraTagOrBranch=%2
  22. SET IsTag=1
  23. SHIFT
  24. )
  25. SHIFT
  26. goto arg_loop_start
  27. )
  28. @Rem Name and version of ps-infra that we are downloading
  29. SET PSInfraOrg=EpicGames
  30. SET PSInfraRepo=PixelStreamingInfrastructure
  31. @Rem If a UE version is supplied set the right branch or tag to fetch for that version of UE
  32. if DEFINED UEVersion (
  33. if "%UEVersion%"=="4.26" (
  34. SET PSInfraTagOrBranch=UE4.26
  35. SET IsTag=0
  36. )
  37. if "%UEVersion%"=="4.27" (
  38. SET PSInfraTagOrBranch=UE4.27
  39. SET IsTag=0
  40. )
  41. if "%UEVersion%"=="5.0" (
  42. SET PSInfraTagOrBranch=UE5.0
  43. SET IsTag=0
  44. )
  45. )
  46. @Rem If no arguments select a specific version, fetch the appropriate default
  47. if NOT DEFINED PSInfraTagOrBranch (
  48. SET PSInfraTagOrBranch=UE5.1
  49. SET IsTag=0
  50. )
  51. @Rem Whether the named reference is a tag or a branch affects the URL we fetch it on
  52. if %IsTag%==1 (
  53. SET RefType=tags
  54. ) else (
  55. SET RefType=heads
  56. )
  57. @Rem Look for a SignallingWebServer directory next to this script
  58. if exist SignallingWebServer\ (
  59. echo SignallingWebServer directory found...skipping install.
  60. ) else (
  61. echo SignallingWebServer directory not found...beginning ps-infra download.
  62. @Rem Download ps-infra and follow redirects.
  63. curl -L https://github.com/%PSInfraOrg%/%PSInfraRepo%/archive/refs/%RefType%/%PSInfraTagOrBranch%.zip > ps-infra.zip
  64. @Rem Unarchive the .zip
  65. tar -xmf ps-infra.zip || echo bad archive, contents: && type ps-infra.zip && exit 0
  66. @Rem Rename the extracted, versioned, directory
  67. for /d %%i in ("PixelStreamingInfrastructure-*") do (
  68. for /d %%j in ("%%i/*") do (
  69. echo "%%i\%%j"
  70. move "%%i\%%j" .
  71. )
  72. for %%j in ("%%i/*") do (
  73. echo "%%i\%%j"
  74. move "%%i\%%j" .
  75. )
  76. echo "%%i"
  77. rmdir /s /q "%%i"
  78. )
  79. @Rem Delete the downloaded zip
  80. del ps-infra.zip
  81. )
  82. exit 0
  83. :print_help
  84. echo.
  85. echo Tool for fetching PixelStreaming Infrastructure. If no flags are set specifying a version to fetch,
  86. echo the recommended version will be chosen as a default.
  87. echo.
  88. echo Usage:
  89. echo %~n0%~x0 [^/h] [^/v ^<UE version^>] [^/b ^<branch^>] [^/t ^<tag^>]
  90. echo Where:
  91. echo /v Specify a version of Unreal Engine to download the recommended release for
  92. echo /b Specify a specific branch for the tool to download from repo
  93. echo /t Specify a specific tag for the tool to download from repo
  94. echo /h Display this help message
  95. exit 1