Provides automatic installation scripts for OpenRA with Tiberian Sun & Red Alert 2 + Dune 2 (Windows, Linux)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
5.7 KiB

8 years ago
  1. #------------------------------------------------------
  2. ## Prepare the script for possible Ctrl+C termination
  3. while ($true)
  4. {
  5. #------------------------------------------------------
  6. ## Initial script messages
  7. "***Welcome Comrade***"
  8. Start-Sleep -s 3
  9. "`nThis script will generate OpenRA with Tiberian Sun & Red Alert 2 for Windows."
  10. Start-Sleep -s 4
  11. "`n- Make sure you have Microsoft .NET Framework 4.5 installed on your computer."
  12. Start-Sleep -s 3
  13. "`n- This script is NOT made by the OpenRA developers and may contain bugs."
  14. Start-Sleep -s 3
  15. "`n- If you worry about what the script is doing, you can always check its code (\data\install.ps1)"
  16. Start-Sleep -s 4
  17. "`n- Press Ctrl+C if you want terminate script execution."
  18. Start-Sleep -s 4
  19. "`n***Starting execution sequence now***"
  20. Start-Sleep -s 3
  21. #------------------------------------------------------
  22. ## Remove all old source files if they exist
  23. "`nRemoving all old source files that may exist in the data directory."
  24. Remove-Item .\data\OpenRA-bleed -Force -Recurse -ErrorAction SilentlyContinue
  25. Remove-Item .\data\ra2-master -Force -Recurse -ErrorAction SilentlyContinue
  26. Remove-Item .\data\OpenRA-bleed.zip -Force -ErrorAction SilentlyContinue
  27. Remove-Item .\data\ra2-master.zip -Force -ErrorAction SilentlyContinue
  28. #------------------------------------------------------
  29. ## Prepare Github environment for downloading the source
  30. [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
  31. $client = New-Object System.Net.WebClient
  32. $client.Headers.Add("Authorization","token 1234567890notarealtoken987654321")
  33. $client.Headers.Add("Accept","application/vnd.github.v3.raw")
  34. #------------------------------------------------------
  35. ## Download OpenRA-bleed source code
  36. "`nDownloading OpenRA source files from Github. Please Stand By."
  37. $client.DownloadFile("https://github.com/OpenRA/OpenRA/archive/bleed.zip?ref=bleed",".\data\OpenRA-bleed.zip�)
  38. #------------------------------------------------------
  39. ## Download Red Alert 2 mod files
  40. "`nDownloading Red Alert 2 mod files from Github. Please Stand By."
  41. $client.DownloadFile("https://github.com/OpenRA/ra2/archive/master.zip?ref=master",".\data\ra2-master.zip�)
  42. #------------------------------------------------------
  43. ## Unzip OpenRA-bleed source files
  44. "`nUnzipping OpenRA source files into data folder."
  45. $shell_app=new-object -com shell.application
  46. $filename = "OpenRA-bleed.zip"
  47. $zip_file = $shell_app.namespace((Get-Location).Path + "\data" + "\$filename")
  48. $destination = $shell_app.namespace((Get-Location).Path + "\data")
  49. $destination.Copyhere($zip_file.items())
  50. #------------------------------------------------------
  51. ## Unzip Red Alert 2 mod files
  52. "`nUnzipping Red Alert 2 mod files into data folder."
  53. $shell_app=new-object -com shell.application
  54. $filename2 = "ra2-master.zip"
  55. $zip_file2 = $shell_app.namespace((Get-Location).Path + "\data" + "\$filename2")
  56. $destination = $shell_app.namespace((Get-Location).Path + "\data")
  57. $destination.Copyhere($zip_file2.items())
  58. #------------------------------------------------------
  59. ## Merge OpenRA source files and Red Alert 2 mod files together
  60. "`nMerging OpenRA source & Red Alert 2 mod files."
  61. move-item ".\data\ra2-master\OpenRA.Mods.RA2" ".\data\OpenRA-bleed\OpenRA.Mods.RA2"
  62. move-item ".\data\ra2-master" ".\data\OpenRA-bleed\mods\ra2"
  63. #------------------------------------------------------
  64. ## Prepare OpenRA source code for Tiberian Sun & Red Alert 2
  65. Start-Sleep -s 3
  66. "`nPatching OpenRA source code for Tiberian Sun & Red Alert 2."
  67. cd .\data
  68. .\patch.exe -d OpenRA-bleed -Np1 -i ..\openra-srcpatch.patch
  69. cd ..
  70. #------------------------------------------------------
  71. ## Compile OpenRA with Tiberian Sun & Red Alert 2
  72. "`nCompiling OpenRA with Tiberian Sun & Red Alert 2.`n"
  73. cd .\data\OpenRA-bleed\
  74. .\make.cmd dependencies
  75. .\make.cmd all
  76. cd ..
  77. cd ..
  78. move-item ".\data\OpenRA-bleed\" ".\OpenRA-bleed-tibsunra2"
  79. #------------------------------------------------------
  80. ## Post-installation messages
  81. "`nCompilation process completed. You find the game inside 'OpenRA-bleed-tibsunra2' folder"
  82. Start-Sleep -s 4
  83. "`nTO PLAY OPENRA: Click OpenRA.exe (maybe you should create a desktop shortcut for it?)"
  84. "`nTO PLAY TIBERIAN SUN: Launch the game and download the required asset files from the web when the game asks you to do so."
  85. "`nTO PLAY RED ALERT 2: you must install language.mix, multi.mix, ra2.mix and theme.mix into \My Documents\OpenRA\Content\ra2\ folder.`nYou find these files from original RA2 installation media (CD's):`n`ntheme.mix, multi.mix = RA2 CD Root folder`nra2.mix, language.mix = RA2 CD Root/INSTALL/Game1.CAB (inside that archive file)"
  86. "`nMULTIPLAYER: It's recommended to use exactly same compiled EXE files (and other stuff) for multiplayer usage to minimize possible version differences/conflicts between players. If your friends compiles this package with another operating system, please make sure they use exactly same source files for their OpenRA compilation process."
  87. "`nUNINSTALLATION: Since the game has been compiled from source and no additional setup programs are provided, all you need to do is to delete the contents of 'OpenRA-bleed-tibsunra2' folder and \My Documents\OpenRA\"
  88. "`nHave fun!"
  89. exit
  90. #------------------------------------------------------
  91. ## Termination code for the script (Ctrl + C)
  92. if ($Host.UI.RawUI.KeyAvailable -and (3 -eq [int]$Host.UI.RawUI.ReadKey("AllowCtrlC,IncludeKeyUp,NoEcho").Character))
  93. {
  94. write-host "Installation script terminated by user."
  95. $key = $Host.UI.RawUI.ReadKey("NoEcho, IncludeKeyDown")
  96. if ($key.Character -eq "N") { break; }
  97. }
  98. }