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.

480 lines
20 KiB

  1. #------------------------------------------------------
  2. ## Prepare the script for possible Ctrl+C termination
  3. while ($true)
  4. {
  5. #------------------------------------------------------
  6. ## Test Internet connection
  7. If (-Not (Test-Connection -computer github.com -count 3 -quiet)) {
  8. "`nCan't connect to Github. Please check your internet connection and try again."
  9. exit
  10. }
  11. #------------------------------------------------------
  12. ## Initial script messages
  13. "`n***Welcome Comrade***"
  14. Start-Sleep -s 3
  15. "`nThis script will generate OpenRA with Tiberian Sun & Red Alert 2 for Windows."
  16. Start-Sleep -s 4
  17. "`n- Make sure you have Microsoft .NET Framework 4.5 installed on your computer."
  18. Start-Sleep -s 3
  19. "`n- This script is NOT made by the OpenRA developers and may have bugs."
  20. Start-Sleep -s 3
  21. "`n- If you worry about what the script is doing, you can always check its code (\data\windows\install.ps1)"
  22. Start-Sleep -s 4
  23. "`n- Press Ctrl+C if you want terminate script execution."
  24. Start-Sleep -s 4
  25. "`n***Starting execution sequence now***"
  26. Start-Sleep -s 3
  27. #------------------------------------------------------
  28. ## Hotfix question
  29. If (Test-Path ".\data\hotfixes\windows\*.patch"){
  30. "`n- Hotfixes -- Question`n"
  31. "Use custom hotfixes if added by the user (Default: No)?\nNOTE: If you choose YES (y), be aware that your OpenRA/RA2 version will likely not be compatible with the other players unless they've applied exactly same hotfixes in their game versions, too!"
  32. "`nAvailable hotfixes are:"
  33. ##List available hotfix files:
  34. get-childitem ".\data\hotfixes\windows\" -recurse | where {$_.extension -eq '.patch'} | format-table Name
  35. "More information about hotfixes: https://github.com/Fincer/openra-tibsunra2/#about-patches--hotfixes`n"
  36. $hotfixes = Read-Host "Use these hotfixes? (y/N)"
  37. #Remove spaces if entered
  38. $hotfixes = $hotfixes -replace '\s',''
  39. if ($hotfixes -eq "y") {
  40. "`nHotfixes applied. Continuing."
  41. } else {
  42. "`nHotfixes ignored and skipped. Continuing."
  43. }
  44. }Else{
  45. "`nAvailable hotfixes: None"
  46. }
  47. "`n- Dune 2 -- Question`n"
  48. $dune2_install = Read-Host "Additionally, Dune 2 can be installed, too. Do you want to install it? [y/N] (Default: y)"
  49. #Remove spaces if entered
  50. $dune2_install = $dune2_install -replace '\s',''
  51. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  52. "`nInstall Dune 2: Yes"
  53. } else {
  54. "`nInstall Dune 2: No"
  55. }
  56. Start-Sleep -s 2
  57. #------------------------------------------------------
  58. ## Remove all old source files if they exist
  59. "`nRemoving all old source files that may exist in the data directory."
  60. Remove-Item .\data\windows\OpenRA-bleed -Force -Recurse -ErrorAction SilentlyContinue
  61. Remove-Item .\data\windows\ra2-master -Force -Recurse -ErrorAction SilentlyContinue
  62. Remove-Item .\data\windows\d2-master -Force -Recurse -ErrorAction SilentlyContinue
  63. Remove-Item .\data\windows\OpenRA-bleed.zip -Force -ErrorAction SilentlyContinue
  64. Remove-Item .\data\windows\ra2-master.zip -Force -ErrorAction SilentlyContinue
  65. Remove-Item .\data\windows\d2-master.zip -Force -ErrorAction SilentlyContinue
  66. Remove-Item .\data\windows\*.html -Force -ErrorAction SilentlyContinue
  67. Remove-Item .\data\windows\*.txt -Force -ErrorAction SilentlyContinue
  68. Remove-Item .\data\windows\*.zip -Force -ErrorAction SilentlyContinue
  69. Remove-Item .\data\windows\*.patch -Force -ErrorAction SilentlyContinue
  70. #------------------------------------------------------
  71. ## Prepare Github environment for downloading the source
  72. [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
  73. $client = New-Object System.Net.WebClient
  74. $client.Headers.Add("Authorization","token 1234567890notarealtoken987654321")
  75. $client.Headers.Add("Accept","application/vnd.github.v3.raw")
  76. #------------------------------------------------------
  77. ## Download OpenRA-bleed source code
  78. "`nDownloading OpenRA source files from Github. Please Stand By."
  79. $client.DownloadFile("https://github.com/OpenRA/OpenRA/archive/bleed.zip?ref=bleed",".\data\windows\OpenRA-bleed.zip")
  80. #------------------------------------------------------
  81. ## Download Red Alert 2 mod files
  82. "`nDownloading Red Alert 2 mod files from Github. Please Stand By."
  83. $client.DownloadFile("https://github.com/OpenRA/ra2/archive/master.zip?ref=master",".\data\windows\ra2-master.zip")
  84. #------------------------------------------------------
  85. ## Download Dune 2 mod files
  86. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  87. "`nDownloading Dune 2 mod files from Github. Please Stand By."
  88. $client.DownloadFile("https://github.com/OpenRA/d2/archive/master.zip?ref=master",".\data\windows\d2-master.zip")
  89. }
  90. #------------------------------------------------------
  91. ## Unzip OpenRA-bleed source files
  92. "`nUnzipping OpenRA source files into \data\windows folder."
  93. $shell_app=new-object -com shell.application
  94. $filename = "OpenRA-bleed.zip"
  95. $zip_file = $shell_app.namespace((Get-Location).Path + "\data\windows" + "\$filename")
  96. $destination = $shell_app.namespace((Get-Location).Path + "\data\windows")
  97. $destination.Copyhere($zip_file.items())
  98. #------------------------------------------------------
  99. ## Unzip Red Alert 2 mod files
  100. "`nUnzipping Red Alert 2 mod files into \data\windows folder."
  101. $shell_app=new-object -com shell.application
  102. $filename2 = "ra2-master.zip"
  103. $zip_file2 = $shell_app.namespace((Get-Location).Path + "\data\windows" + "\$filename2")
  104. $destination = $shell_app.namespace((Get-Location).Path + "\data\windows")
  105. $destination.Copyhere($zip_file2.items())
  106. #------------------------------------------------------
  107. ## Unzip Dune 2 mod files
  108. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  109. "`nUnzipping Dune 2 mod files into \data\windows folder."
  110. $shell_app=new-object -com shell.application
  111. $filename3 = "d2-master.zip"
  112. $zip_file3 = $shell_app.namespace((Get-Location).Path + "\data\windows" + "\$filename3")
  113. $destination = $shell_app.namespace((Get-Location).Path + "\data\windows")
  114. $destination.Copyhere($zip_file3.items())
  115. }
  116. #------------------------------------------------------
  117. ## Merge OpenRA source files and Red Alert 2 (& Dune 2) mod files together
  118. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  119. "`nMerging OpenRA source & Red Alert 2 + Dune 2 mod files."
  120. Copy-Item -Recurse ".\data\windows\d2-master\OpenRA.Mods.D2" ".\data\windows\OpenRA-bleed\OpenRA.Mods.D2"
  121. Copy-Item -Recurse ".\data\windows\d2-master" ".\data\windows\OpenRA-bleed\mods\d2"
  122. Remove-Item -Recurse .\data\windows\d2-master\*
  123. Copy-Item -Recurse ".\data\windows\ra2-master\OpenRA.Mods.RA2" ".\data\windows\OpenRA-bleed\OpenRA.Mods.RA2"
  124. Copy-Item -Recurse ".\data\windows\ra2-master" ".\data\windows\OpenRA-bleed\mods\ra2"
  125. } else {
  126. "`nMerging OpenRA source & Red Alert 2 mod files."
  127. Copy-Item -Recurse ".\data\windows\ra2-master\OpenRA.Mods.RA2" ".\data\windows\OpenRA-bleed\OpenRA.Mods.RA2"
  128. Copy-Item -Recurse ".\data\windows\ra2-master" ".\data\windows\OpenRA-bleed\mods\ra2"
  129. }
  130. Remove-Item -Recurse .\data\windows\ra2-master\*
  131. #------------------------------------------------------
  132. ## Get OpenRA Git version number
  133. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  134. "`nRetrieving OpenRA & Red Alert 2 + Dune 2 Git version numbers."
  135. } else {
  136. "`nRetrieving OpenRA & Red Alert 2 Git version numbers."
  137. }
  138. $web = New-Object System.Net.WebClient
  139. $web.DownloadFile("https://github.com/OpenRA/OpenRA",".\data\windows\openra-github.html")
  140. $flag=0
  141. Get-Content .\data\windows\openra-github.html |
  142. foreach {
  143. Switch -Wildcard ($_){
  144. "*Latest commit*" {$flag=1}
  145. "*time datetime*" {$flag=0}
  146. }
  147. if ($flag -eq 1){
  148. Out-File .\data\windows\openra-html-stripped.txt -InputObject $_ -Append
  149. }
  150. }
  151. (Get-Content .\data\windows\openra-html-stripped.txt)[2] -replace '\s','' | Foreach-Object{ 'git-' + $_ } > .\data\windows\openra-latestcommit.txt
  152. $openra_gitversion = [IO.File]::ReadAllText(".\data\windows\openra-latestcommit.txt").trim("`r`n")
  153. Write-Output "`nOpenRA version: $openra_gitversion"
  154. #This is used in folder name
  155. $openra_folderversion = [IO.File]::ReadAllText(".\data\windows\openra-latestcommit.txt").trim("`r`ngit")
  156. #------------------------------------------------------
  157. ## Get Red Alert 2 Git version number
  158. $web = New-Object System.Net.WebClient
  159. $web.DownloadFile("https://github.com/OpenRA/ra2",".\data\windows\ra2-github.html")
  160. $flag=0
  161. Get-Content .\data\windows\ra2-github.html |
  162. foreach {
  163. Switch -Wildcard ($_){
  164. "*Latest commit*" {$flag=1}
  165. "*time datetime*" {$flag=0}
  166. }
  167. if ($flag -eq 1){
  168. Out-File .\data\windows\ra2-html-stripped.txt -InputObject $_ -Append
  169. }
  170. }
  171. (Get-Content .\data\windows\ra2-html-stripped.txt)[2] -replace '\s','' | Foreach-Object{ 'git-' + $_ } > .\data\windows\ra2-latestcommit.txt
  172. $ra2_gitversion = [IO.File]::ReadAllText(".\data\windows\ra2-latestcommit.txt").trim("`r`n")
  173. Write-Output "RA2 version: $ra2_gitversion"
  174. #This is used in folder name
  175. $ra2_folderversion = [IO.File]::ReadAllText(".\data\windows\ra2-latestcommit.txt").trim("`r`ngit")
  176. #------------------------------------------------------
  177. ## Get Dune 2 Git version number
  178. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  179. $web = New-Object System.Net.WebClient
  180. $web.DownloadFile("https://github.com/OpenRA/d2",".\data\windows\d2-github.html")
  181. $flag=0
  182. Get-Content .\data\windows\d2-github.html |
  183. foreach {
  184. Switch -Wildcard ($_){
  185. "*Latest commit*" {$flag=1}
  186. "*time datetime*" {$flag=0}
  187. }
  188. if ($flag -eq 1){
  189. Out-File .\data\windows\d2-html-stripped.txt -InputObject $_ -Append
  190. }
  191. }
  192. (Get-Content .\data\windows\d2-html-stripped.txt)[2] -replace '\s','' | Foreach-Object{ 'git-' + $_ } > .\data\windows\d2-latestcommit.txt
  193. $d2_gitversion = [IO.File]::ReadAllText(".\data\windows\d2-latestcommit.txt").trim("`r`n")
  194. Write-Output "Dune 2 version: $d2_gitversion"
  195. #This is used in folder name
  196. $d2_folderversion = [IO.File]::ReadAllText(".\data\windows\d2-latestcommit.txt").trim("`r`ngit")
  197. }
  198. #------------------------------------------------------
  199. ## Prepare OpenRA source code for Tiberian Sun & Red Alert 2 (& Dune 2)
  200. #Add patches & hotfixes
  201. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  202. Copy-Item ".\data\patches\windows\*.patch" ".\data\windows"
  203. if ($hotfixes -eq "y") {
  204. Copy-Item ".\data\hotfixes\windows\*.patch" ".\data\windows"
  205. }
  206. #These files will conflict with windows-d2-ra2-make.patch & windows-d2-ra2-openra-solution.patch
  207. Remove-Item .\data\windows\windows-ra2-make.patch -Force -ErrorAction SilentlyContinue
  208. Remove-Item .\data\windows\windows-ra2-openra-solution.patch -Force -ErrorAction SilentlyContinue
  209. } else {
  210. Copy-Item ".\data\patches\windows\*.patch" ".\data\windows"
  211. if ($hotfixes -eq "y") {
  212. Copy-Item ".\data\hotfixes\windows\*.patch" ".\data\windows"
  213. }
  214. #Remove Dune 2 patches
  215. Remove-Item .\data\windows\windows-d2*.patch -Force -ErrorAction SilentlyContinue
  216. }
  217. Start-Sleep -s 3
  218. #Start patching operation
  219. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  220. "`nPatching OpenRA source code for Tiberian Sun & Red Alert 2 + Dune 2."
  221. } else {
  222. "`nPatching OpenRA source code for Tiberian Sun & Red Alert 2."
  223. }
  224. cd .\data\windows
  225. "`nFor each time a patch/hotfix is being applied, UAC may ask permission for patch.exe."
  226. $patchcount = (Get-Childitem .\ | where {$_.extension -eq ".patch"} | Measure-Object ).Count;
  227. Write-Output "`nExecuting patch.exe $patchcount times now."
  228. Start-Sleep -s 6
  229. Get-ChildItem .\ -include *.patch -recurse | Foreach ($_) {.\patch.exe -d OpenRA-bleed -Np1 -i $_.fullname }
  230. cd ..
  231. cd ..
  232. #------------------------------------------------------
  233. ## Push version numbers to mod files
  234. # Red Alert
  235. (Get-Content .\data\windows\Openra-bleed\mods\ra\mod.yaml) -replace '{DEV_VERSION}',$openra_gitversion | Set-Content .\data\windows\Openra-bleed\mods\ra\mod.yaml
  236. # Tiberian Dawn
  237. (Get-Content .\data\windows\Openra-bleed\mods\cnc\mod.yaml) -replace '{DEV_VERSION}',$openra_gitversion | Set-Content .\data\windows\Openra-bleed\mods\cnc\mod.yaml
  238. # Dune 2K
  239. (Get-Content .\data\windows\Openra-bleed\mods\d2k\mod.yaml) -replace '{DEV_VERSION}',$openra_gitversion | Set-Content .\data\windows\Openra-bleed\mods\d2k\mod.yaml
  240. # Tiberian Sun
  241. (Get-Content .\data\windows\Openra-bleed\mods\ts\mod.yaml) -replace '{DEV_VERSION}',$openra_gitversion | Set-Content .\data\windows\Openra-bleed\mods\ts\mod.yaml
  242. # Red Alert 2
  243. (Get-Content .\data\windows\Openra-bleed\mods\ra2\mod.yaml) -replace '{DEV_VERSION}',$ra2_gitversion | Set-Content .\data\windows\Openra-bleed\mods\ra2\mod.yaml
  244. # Mod Chooser
  245. (Get-Content .\data\windows\Openra-bleed\mods\modchooser\mod.yaml) -replace '{DEV_VERSION}',$openra_gitversion | Set-Content .\data\windows\Openra-bleed\mods\modchooser\mod.yaml
  246. # All
  247. (Get-Content .\data\windows\Openra-bleed\mods\all\mod.yaml) -replace '{DEV_VERSION}',$openra_gitversion | Set-Content .\data\windows\Openra-bleed\mods\all\mod.yaml
  248. #Dune 2
  249. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  250. (Get-Content .\data\windows\Openra-bleed\mods\d2\mod.yaml) -replace '{DEV_VERSION}',$d2_gitversion | Set-Content .\data\windows\Openra-bleed\mods\d2\mod.yaml
  251. }
  252. #------------------------------------------------------
  253. ## Remove temporary files
  254. Remove-Item .\data\windows\*.html
  255. Remove-Item .\data\windows\*.txt
  256. Remove-Item .\data\windows\*.zip
  257. Remove-Item .\data\windows\*.patch
  258. #------------------------------------------------------
  259. ## Compile OpenRA with Tiberian Sun & Red Alert 2
  260. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  261. "`nCompiling OpenRA with Tiberian Sun & Red Alert 2 + Dune 2.`n"
  262. } else {
  263. "`nCompiling OpenRA with Tiberian Sun & Red Alert 2.`n"
  264. }
  265. cd .\data\windows\OpenRA-bleed\
  266. .\make.cmd dependencies
  267. .\make.cmd all
  268. cd ..
  269. cd ..
  270. cd ..
  271. "`nCopying OpenRA files to the final location. This takes a while. Please wait.`n"
  272. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Platforms.Default
  273. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.Common
  274. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.Cnc
  275. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.D2k
  276. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.RA2
  277. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Server
  278. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Test
  279. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Utility
  280. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.GameMonitor
  281. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Game
  282. Remove-Item -Recurse .\data\windows\OpenRA-bleed\packaging
  283. Remove-Item -Recurse .\data\windows\OpenRA-bleed\thirdparty
  284. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  285. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.D2
  286. }
  287. Remove-Item .\data\windows\OpenRA-bleed\.editorconfig
  288. Remove-Item .\data\windows\OpenRA-bleed\.gitattributes
  289. Remove-Item .\data\windows\OpenRA-bleed\.gitignore
  290. Remove-Item .\data\windows\OpenRA-bleed\.kateproject
  291. Remove-Item .\data\windows\OpenRA-bleed\.travis.yml
  292. Remove-Item .\data\windows\OpenRA-bleed\CONTRIBUTING.md
  293. Remove-Item .\data\windows\OpenRA-bleed\COPYING
  294. Remove-Item .\data\windows\OpenRA-bleed\ConvertFrom-Markdown.ps1
  295. Remove-Item .\data\windows\OpenRA-bleed\INSTALL.md
  296. Remove-Item .\data\windows\OpenRA-bleed\Makefile
  297. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.sln
  298. Remove-Item .\data\windows\OpenRA-bleed\README.md
  299. Remove-Item .\data\windows\OpenRA-bleed\Settings.StyleCop
  300. Remove-Item .\data\windows\OpenRA-bleed\make.ps1
  301. Remove-Item .\data\windows\OpenRA-bleed\make.cmd
  302. Remove-Item .\data\windows\OpenRA-bleed\launch-game.sh
  303. Remove-Item .\data\windows\OpenRA-bleed\launch-dedicated.sh
  304. Remove-Item .\data\windows\OpenRA-bleed\appveyor.yml
  305. Remove-Item .\data\windows\OpenRA-bleed\dupFinder.xslt
  306. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Game.pdb
  307. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Server.pdb
  308. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Platforms.Default.pdb
  309. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Test.nunit
  310. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Test.pdb
  311. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.pdb
  312. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Utility.pdb
  313. Remove-Item .\data\windows\OpenRA-bleed\AUTHORS
  314. Remove-Item .\data\windows\OpenRA-bleed\mods\common\OpenRA.Mods.Cnc.pdb
  315. Remove-Item .\data\windows\OpenRA-bleed\mods\common\OpenRA.Mods.Common.pdb
  316. Remove-Item .\data\windows\OpenRA-bleed\mods\d2k\OpenRA.Mods.D2k.pdb
  317. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\build.cake
  318. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\makefile
  319. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\make.ps1
  320. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\.gitattributes
  321. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\.gitignore
  322. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\.travis.yml
  323. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\make.cmd
  324. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\fetch-content.sh
  325. Remove-Item -Recurse .\data\windows\OpenRA-bleed\mods\ra2\OpenRA.Mods.RA2
  326. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  327. Remove-Item -Recurse .\data\windows\OpenRA-bleed\mods\d2\OpenRA.Mods.D2
  328. Copy-Item -Recurse ".\data\windows\OpenRA-bleed\" ".\OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion-d2$d2_folderversion"
  329. Remove-Item .\data\windows\d2-master
  330. } else {
  331. Copy-Item -Recurse ".\data\windows\OpenRA-bleed\" ".\OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion"
  332. }
  333. Remove-Item .\data\windows\OpenRA-bleed\* -Recurse
  334. Remove-Item .\data\windows\OpenRA-bleed
  335. Remove-Item .\data\windows\ra2-master
  336. #------------------------------------------------------
  337. ## Post-installation messages
  338. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  339. "`nCompilation process completed. You find the game inside 'OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion-d2$d2_folderversion' folder"
  340. } else {
  341. "`nCompilation process completed. You find the game inside 'OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion' folder"
  342. }
  343. Start-Sleep -s 4
  344. "`nTO PLAY OPENRA: Click OpenRA.exe (maybe you should create a desktop shortcut for it?)"
  345. "`nTO PLAY TIBERIAN SUN: Launch the game and download the required asset files from the web when the game asks you to do so."
  346. "`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)"
  347. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  348. "`nTO PLAY DUNE 2: Please see https://github.com/Fincer/openra-tibsunra2/ front page for further instructions."
  349. }
  350. "`nMULTIPLAYER: It's recommended to build OpenRA using exactly same GIT source files for multiplayer usage to minimize possible version differences/conflicts between players. Please make sure all players have exactly same git versions of their in-game mods (RA, CNC, D2K, TS, RA2). Version numbers are formatted like 'git-e0d7445' etc. and can be found in each mod description in the mod selection menu."
  351. "`nFor this compilation, the version numbers are as follows:"
  352. Write-Output "OpenRA version: $openra_gitversion"
  353. Write-Output "RA2 version: $ra2_gitversion"
  354. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  355. Write-Output "Dune 2 version: $d2_gitversion"
  356. }
  357. "`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\"
  358. "`nHave fun!"
  359. exit
  360. #------------------------------------------------------
  361. ## Termination code for the script (Ctrl + C)
  362. if ($Host.UI.RawUI.KeyAvailable -and (3 -eq [int]$Host.UI.RawUI.ReadKey("AllowCtrlC,IncludeKeyUp,NoEcho").Character))
  363. {
  364. write-host "Installation script terminated by user."
  365. $key = $Host.UI.RawUI.ReadKey("NoEcho, IncludeKeyDown")
  366. if ($key.Character -eq "N") { break; }
  367. }
  368. }