Advertisement
Victoralm

InstallUE4.sh

Feb 5th, 2015
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.01 KB | None | 0 0
  1. #!/bin/bash
  2. Encoding=UTF-8
  3. echo '******************************************************************'
  4. echo 'Unreal Engine 4 installer'
  5. echo 'Tested on Ubuntu 14.04'
  6. echo
  7. echo 'Based on: https://wiki.unrealengine.com/Building_On_Linux#Foreword_before_building'
  8. echo '******************************************************************'
  9.  
  10. #---******************************************---
  11. ptbr_msg[0]='Iniciando a instalação !!'
  12. ptbr_msg[1]='Será necessário fazer a instalação de diversas dependências pelo apt-get e, em seguida o sistema precisará ser reiniciado.'
  13. ptbr_msg[2]='Caso essa seja a primeira vez que você instala a UE4 em seu sistema, digite "S" (sem áspas). Caso já tenha previamente executado a instalação das dependências e reiniciado o sistema, digite "n" (sem áspas)'
  14. ptbr_msg[3]='Deseja prosseguir com a instalação das dependências !? (S / n):'
  15. ptbr_msg[4]='O sistema precisa ser reiniciado. Deseja prosseguir !? (S / n):'
  16. ptbr_msg[5]='O sistema será reiniciado agora. Lembre-se: Após a reinicialização, execute novamente este script e digite "n" (sem áspas) quando questionado sobre as dependências.'
  17. ptbr_msg[6]='Encerrando a execução do script'
  18. ptbr_msg[7]='Seguindo com a instalação da Unreal Engine 4'
  19. ptbr_msg[8]='A instalação deverá ser feita na "/home" de seu usuário'
  20. ptbr_msg[9]='Digite o nome de seu usuário padrão (não o root):'
  21. ptbr_msg[10]='Gerando os ícones para o menu do Ubuntu'
  22. ptbr_msg[11]='Instalação finalizada. Forte abraço !!'
  23. ptbr_msg[12]='Usuário inexistente. Tentar novamente !? (S / n):'
  24.  
  25. eng_msg[0]='Starting the installation !!'
  26. eng_msg[1]='Will need to install several dependencies by apt-get, and then the system must be restarted.'
  27. eng_msg[2]='If this is the first time you install the EU4 on your system, type "Y" (without quotes). If you have previously run the installation dependencies and restarted the system, type "n" (without quotes)'
  28. eng_msg[3]='Wish to proceed with the installation of dependencies!? (Y / n):'
  29. eng_msg[4]='The system must be restarted. Want to keep up!? (Y / n):'
  30. eng_msg[5]='The system will reboot now. Remember: After reboot, run this script again and type "n" (without quotes) when asked about the dependencies.'
  31. eng_msg[6]='Closing the script execution'
  32. eng_msg[7]='Following the installation of the Unreal Engine 4'
  33. eng_msg[8]='The installation should be done in the "/ home" of your user'
  34. eng_msg[9]='Enter the name of your default user (not root):'
  35. eng_msg[10]='Generating the icons to the Ubuntu menu'
  36. eng_msg[11]='Installation completed. Best regards !!'
  37. eng_msg[12]='User nonexistent. Try again!? (Y / n):'
  38. #---******************************************---
  39.  
  40. echo
  41. echo 'Encolha uma linguagem para rodar este script:
  42. Chose a language to run this script: (p / e)'
  43. echo 'Digite "p" (sem áspas) para português.
  44. Type "e" (without quotes) for english.'
  45. read lang
  46. lng=${lang,,}
  47.  
  48. echo
  49. if [ $lng == "p" ]; then
  50.     echo ${ptbr_msg[0]}
  51. else
  52.     echo ${eng_msg[0]}
  53. fi
  54. echo
  55.  
  56. if [ $lng == "p" ]; then
  57.     echo ${ptbr_msg[1]}
  58. else
  59.     echo ${eng_msg[1]}
  60. fi
  61.  
  62. if [ $lng == "p" ]; then
  63.     echo ${ptbr_msg[2]}
  64. else
  65.     echo ${eng_msg[2]}
  66. fi
  67.  
  68. if [ $lng == "p" ]; then
  69.     echo ${ptbr_msg[3]}
  70. else
  71.     echo ${eng_msg[3]}
  72. fi
  73. read depend
  74. dpd=${depend,,}
  75. if [[ $dpd == +(s|sim|y|yes) ]]; then
  76.     sudo apt-add-repository ppa:oibaf/graphics-drivers -y && sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get install mono-gmcs mono-xbuild mono-dmcs libmono-corlib4.0-cil libmono-system-data-datasetextensions4.0-cil libmono-system-web-extensions4.0-cil libmono-system-management4.0-cil libmono-system-xml-linq4.0-cil cmake dos2unix clang-3.3 libfreetype6-dev libsdl2-dev libgtk-3-dev libmono-microsoft-build-tasks-v4.0-4.0-cil kdevelop
  77.     echo
  78.     if [ $lng == "p" ]; then
  79.         echo ${ptbr_msg[4]}
  80.     else
  81.         echo ${eng_msg[4]}
  82.     fi
  83.     read resp
  84.     rsp=${resp,,}
  85.     if [[ $rsp == +(s|sim|y|yes) ]]; then
  86.         if [ $lng == "p" ]; then
  87.             echo ${ptbr_msg[5]}
  88.         else
  89.             echo ${eng_msg[5]}
  90.         fi
  91.         sudo reboot
  92.     else
  93.         if [ $lng == "p" ]; then
  94.             echo ${ptbr_msg[6]}
  95.         else
  96.             echo ${eng_msg[6]}
  97.         fi
  98.         exit
  99.     fi
  100. else
  101.     if [ $lng == "p" ]; then
  102.         echo ${ptbr_msg[7]}
  103.     else
  104.         echo ${eng_msg[7]}
  105.     fi
  106. fi
  107.  
  108. HomeInstall() {
  109.     echo
  110.     if [ $lng == "p" ]; then
  111.         echo ${ptbr_msg[8]}
  112.     else
  113.         echo ${eng_msg[8]}
  114.     fi
  115.     if [ $lng == "p" ]; then
  116.         echo ${ptbr_msg[9]}
  117.     else
  118.         echo ${eng_msg[9]}
  119.     fi
  120.     read user
  121.     usr=${user,,}
  122.    
  123.     if [ ! -z `cat /etc/passwd|grep $usr` ]; then
  124.         clear
  125.         hdir=/home/$usr
  126.         cd $hdir
  127.         git clone git@github.com:EpicGames/UnrealEngine.git
  128.         cd UnrealEngine
  129.         ./Setup.sh
  130.  
  131.         git pull
  132.         ./GenerateProjectFiles.sh
  133.         make SlateViewer
  134.  
  135.         make ShaderCompileWorker UnrealLightmass UnrealPak UE4Editor
  136.  
  137.  
  138.         if [ $lng == "p" ]; then
  139.             echo
  140.             echo ${ptbr_msg[10]}
  141.         else
  142.             echo
  143.             echo ${eng_msg[10]}
  144.         fi
  145.         GScript=$'#!/bin/bash\rcd /home/'$usr$'/UnrealEngine/Engine/Binaries/Linux && ./UE4Editor'
  146.         GMenu=$'[Desktop Entry]\rName=UE4Editor\rComment=Unreal Engine 4 - game build engine\rExec=UE4Editor\rGenericName=UE4Editor\rCategories=IDE;Development;Utility;\rIcon='$hdir$'/UnrealEngine/Engine/Content/Slate/Testing/UE4Icon.png\rGenericName=UE4Editor\rNoDisplay=false\rStartupNotify=false\rTerminal=0\rTerminalOptions=\rType=Application'
  147.         SDir=/usr/local/bin
  148.         DDir=/usr/share/applications
  149.         mkdir cdicon
  150.         touch cdicon/UE4Editor
  151.         touch cdicon/UE4Editor.desktop
  152.         echo $GScript >> cdicon/UE4Editor
  153.         echo $GMenu >> cdicon/UE4Editor.desktop
  154.         chmod +x cdicon/UE4Editor
  155.         sudo mv cdicon/UE4Editor $SDir
  156.         sudo mv cdicon/UE4Editor.desktop $DDir
  157.         rm -rf cdicon/
  158.  
  159.         if [ $lng == "p" ]; then
  160.             echo
  161.             echo ${ptbr_msg[11]}
  162.         else
  163.             echo
  164.             echo ${eng_msg[11]}
  165.         fi
  166.     else
  167.         if [ $lng == "p" ]; then
  168.             echo
  169.             echo ${ptbr_msg[12]}
  170.         else
  171.             echo
  172.             echo ${eng_msg[12]}
  173.         fi
  174.         read resp
  175.         rsp=${resp,,}
  176.         if [[ $rsp == +(s|sim|y|yes) ]]; then
  177.             HomeInstall
  178.         else
  179.             if [ $lng == "p" ]; then
  180.                 echo ${ptbr_msg[6]}
  181.             else
  182.                 echo ${eng_msg[6]}
  183.             fi
  184.             exit
  185.         fi
  186.     fi
  187. }
  188. HomeInstall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement