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.

478 lines
21 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. Copy-Item -Recurse ".\data\windows\ra2-master\OpenRA.Mods.RA2" ".\data\windows\OpenRA-bleed\OpenRA.Mods.RA2"
  123. Copy-Item -Recurse ".\data\windows\ra2-master" ".\data\windows\OpenRA-bleed\mods\ra2"
  124. } else {
  125. "`nMerging OpenRA source & Red Alert 2 mod files."
  126. Copy-Item -Recurse ".\data\windows\ra2-master\OpenRA.Mods.RA2" ".\data\windows\OpenRA-bleed\OpenRA.Mods.RA2"
  127. Copy-Item -Recurse ".\data\windows\ra2-master" ".\data\windows\OpenRA-bleed\mods\ra2"
  128. }
  129. Remove-Item -Recurse .\data\windows\ra2-master\*
  130. #------------------------------------------------------
  131. ## Get OpenRA Git version number
  132. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  133. "`nRetrieving OpenRA & Red Alert 2 + Dune 2 Git version numbers."
  134. } else {
  135. "`nRetrieving OpenRA & Red Alert 2 Git version numbers."
  136. }
  137. $web = New-Object System.Net.WebClient
  138. $web.DownloadFile("https://github.com/OpenRA/OpenRA",".\data\windows\openra-github.html")
  139. $flag=0
  140. Get-Content .\data\windows\openra-github.html |
  141. foreach {
  142. Switch -Wildcard ($_){
  143. "*Latest commit*" {$flag=1}
  144. "*time datetime*" {$flag=0}
  145. }
  146. if ($flag -eq 1){
  147. Out-File .\data\windows\openra-html-stripped.txt -InputObject $_ -Append
  148. }
  149. }
  150. (Get-Content .\data\windows\openra-html-stripped.txt)[2] -replace '\s','' | Foreach-Object{ 'git-' + $_ } > .\data\windows\openra-latestcommit.txt
  151. $openra_gitversion = [IO.File]::ReadAllText(".\data\windows\openra-latestcommit.txt").trim("`r`n")
  152. Write-Output "`nOpenRA version: $openra_gitversion"
  153. #This is used in folder name
  154. $openra_folderversion = [IO.File]::ReadAllText(".\data\windows\openra-latestcommit.txt").trim("`r`ngit")
  155. #------------------------------------------------------
  156. ## Get Red Alert 2 Git version number
  157. $web = New-Object System.Net.WebClient
  158. $web.DownloadFile("https://github.com/OpenRA/ra2",".\data\windows\ra2-github.html")
  159. $flag=0
  160. Get-Content .\data\windows\ra2-github.html |
  161. foreach {
  162. Switch -Wildcard ($_){
  163. "*Latest commit*" {$flag=1}
  164. "*time datetime*" {$flag=0}
  165. }
  166. if ($flag -eq 1){
  167. Out-File .\data\windows\ra2-html-stripped.txt -InputObject $_ -Append
  168. }
  169. }
  170. (Get-Content .\data\windows\ra2-html-stripped.txt)[2] -replace '\s','' | Foreach-Object{ 'git-' + $_ } > .\data\windows\ra2-latestcommit.txt
  171. $ra2_gitversion = [IO.File]::ReadAllText(".\data\windows\ra2-latestcommit.txt").trim("`r`n")
  172. Write-Output "RA2 version: $ra2_gitversion"
  173. #This is used in folder name
  174. $ra2_folderversion = [IO.File]::ReadAllText(".\data\windows\ra2-latestcommit.txt").trim("`r`ngit")
  175. #------------------------------------------------------
  176. ## Get Dune 2 Git version number
  177. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  178. $web = New-Object System.Net.WebClient
  179. $web.DownloadFile("https://github.com/OpenRA/d2",".\data\windows\d2-github.html")
  180. $flag=0
  181. Get-Content .\data\windows\d2-github.html |
  182. foreach {
  183. Switch -Wildcard ($_){
  184. "*Latest commit*" {$flag=1}
  185. "*time datetime*" {$flag=0}
  186. }
  187. if ($flag -eq 1){
  188. Out-File .\data\windows\d2-html-stripped.txt -InputObject $_ -Append
  189. }
  190. }
  191. (Get-Content .\data\windows\d2-html-stripped.txt)[2] -replace '\s','' | Foreach-Object{ 'git-' + $_ } > .\data\windows\d2-latestcommit.txt
  192. $d2_gitversion = [IO.File]::ReadAllText(".\data\windows\d2-latestcommit.txt").trim("`r`n")
  193. Write-Output "Dune 2 version: $d2_gitversion"
  194. #This is used in folder name
  195. $d2_folderversion = [IO.File]::ReadAllText(".\data\windows\d2-latestcommit.txt").trim("`r`ngit")
  196. }
  197. #------------------------------------------------------
  198. ## Prepare OpenRA source code for Tiberian Sun & Red Alert 2 (& Dune 2)
  199. #Add patches & hotfixes
  200. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  201. Copy-Item ".\data\patches\windows\*.patch" ".\data\windows"
  202. if ($hotfixes -eq "y") {
  203. Copy-Item ".\data\hotfixes\windows\*.patch" ".\data\windows"
  204. }
  205. #This file will conflict with windows-d2-make-modstrings.patch
  206. Remove-Item .\data\windows\windows-ra2-make-modstrings.patch -Force -ErrorAction SilentlyContinue
  207. } else {
  208. Copy-Item ".\data\patches\windows\*.patch" ".\data\windows"
  209. if ($hotfixes -eq "y") {
  210. Copy-Item ".\data\hotfixes\windows\*.patch" ".\data\windows"
  211. }
  212. #Remove Dune 2 patches
  213. Remove-Item .\data\windows\windows-d2*.patch -Force -ErrorAction SilentlyContinue
  214. }
  215. Start-Sleep -s 3
  216. #Start patching operation
  217. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  218. "`nPatching OpenRA source code for Tiberian Sun & Red Alert 2 + Dune 2."
  219. } else {
  220. "`nPatching OpenRA source code for Tiberian Sun & Red Alert 2."
  221. }
  222. cd .\data\windows
  223. "`nFor each time a patch/hotfix is being applied, UAC may ask permission for patch.exe."
  224. $patchcount = (Get-Childitem .\ | where {$_.extension -eq ".patch"} | Measure-Object ).Count;
  225. Write-Output "`nExecuting patch.exe $patchcount times now."
  226. Start-Sleep -s 6
  227. Get-ChildItem .\ -include *.patch -recurse | Foreach ($_) {.\patch.exe -d OpenRA-bleed -Np1 -i $_.fullname }
  228. cd ..
  229. cd ..
  230. #------------------------------------------------------
  231. ## Push version numbers to mod files
  232. # Red Alert
  233. (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
  234. # Tiberian Dawn
  235. (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
  236. # Dune 2K
  237. (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
  238. # Tiberian Sun
  239. (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
  240. # Red Alert 2
  241. (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
  242. # Mod Chooser
  243. (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
  244. # All
  245. (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
  246. #Dune 2
  247. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  248. (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
  249. }
  250. #------------------------------------------------------
  251. ## Remove temporary files
  252. Remove-Item .\data\windows\*.html
  253. Remove-Item .\data\windows\*.txt
  254. Remove-Item .\data\windows\*.zip
  255. Remove-Item .\data\windows\*.patch
  256. #------------------------------------------------------
  257. ## Compile OpenRA with Tiberian Sun & Red Alert 2
  258. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  259. "`nCompiling OpenRA with Tiberian Sun & Red Alert 2 + Dune 2.`n"
  260. } else {
  261. "`nCompiling OpenRA with Tiberian Sun & Red Alert 2.`n"
  262. }
  263. cd .\data\windows\OpenRA-bleed\
  264. .\make.cmd dependencies
  265. .\make.cmd all
  266. cd ..
  267. cd ..
  268. cd ..
  269. "`nCopying OpenRA files to the final location. This takes a while. Please wait.`n"
  270. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Platforms.Default
  271. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.Common
  272. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.Cnc
  273. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.D2k
  274. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.RA
  275. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.TS
  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\OpenRA.sln.orig
  299. Remove-Item .\data\windows\OpenRA-bleed\README.md
  300. Remove-Item .\data\windows\OpenRA-bleed\Settings.StyleCop
  301. Remove-Item .\data\windows\OpenRA-bleed\make.ps1
  302. Remove-Item .\data\windows\OpenRA-bleed\make.ps1.orig
  303. Remove-Item .\data\windows\OpenRA-bleed\make.cmd
  304. Remove-Item .\data\windows\OpenRA-bleed\launch-game.sh
  305. Remove-Item .\data\windows\OpenRA-bleed\launch-dedicated.sh
  306. Remove-Item .\data\windows\OpenRA-bleed\appveyor.yml
  307. Remove-Item .\data\windows\OpenRA-bleed\dupFinder.xslt
  308. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Game.pdb
  309. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Server.pdb
  310. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Platforms.Default.pdb
  311. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Test.nunit
  312. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Test.pdb
  313. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.pdb
  314. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Utility.pdb
  315. Remove-Item .\data\windows\OpenRA-bleed\AUTHORS
  316. Remove-Item .\data\windows\OpenRA-bleed\mods\cnc\OpenRA.Mods.Cnc.pdb
  317. Remove-Item .\data\windows\OpenRA-bleed\mods\common\OpenRA.Mods.Common.pdb
  318. Remove-Item .\data\windows\OpenRA-bleed\mods\d2k\OpenRA.Mods.D2k.pdb
  319. Remove-Item .\data\windows\OpenRA-bleed\mods\ra\OpenRA.Mods.RA.pdb
  320. Remove-Item .\data\windows\OpenRA-bleed\mods\ts\OpenRA.Mods.TS.pdb
  321. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\build.cake
  322. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\makefile
  323. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\make.ps1
  324. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\mod.yaml.orig
  325. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\.gitattributes
  326. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\.gitignore
  327. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\.travis.yml
  328. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\make.cmd
  329. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\fetch-content.sh
  330. Remove-Item -Recurse .\data\windows\OpenRA-bleed\mods\ra2\OpenRA.Mods.RA2
  331. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  332. Copy-Item -Recurse ".\data\windows\OpenRA-bleed\" ".\OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion-d2$d2_folderversion"
  333. } else {
  334. Copy-Item -Recurse ".\data\windows\OpenRA-bleed\" ".\OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion"
  335. }
  336. Remove-Item .\data\windows\OpenRA-bleed\* -Recurse
  337. Remove-Item .\data\windows\OpenRA-bleed
  338. Remove-Item .\data\windows\ra2-master
  339. #------------------------------------------------------
  340. ## Post-installation messages
  341. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  342. "`nCompilation process completed. You find the game inside 'OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion-d2$d2_folderversion' folder"
  343. } else {
  344. "`nCompilation process completed. You find the game inside 'OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion' folder"
  345. }
  346. Start-Sleep -s 4
  347. "`nTO PLAY OPENRA: Click OpenRA.exe (maybe you should create a desktop shortcut for it?)"
  348. "`nTO PLAY TIBERIAN SUN: Launch the game and download the required asset files from the web when the game asks you to do so."
  349. "`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)"
  350. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  351. "`nTO PLAY DUNE 2: Please see https://github.com/Fincer/openra-tibsunra2/ front page for further instructions."
  352. }
  353. "`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."
  354. "`nFor this compilation, the version numbers are as follows:"
  355. Write-Output "OpenRA version: $openra_gitversion"
  356. Write-Output "RA2 version: $ra2_gitversion"
  357. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  358. Write-Output "Dune 2 version: $d2_gitversion"
  359. }
  360. "`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\"
  361. "`nHave fun!"
  362. exit
  363. #------------------------------------------------------
  364. ## Termination code for the script (Ctrl + C)
  365. if ($Host.UI.RawUI.KeyAvailable -and (3 -eq [int]$Host.UI.RawUI.ReadKey("AllowCtrlC,IncludeKeyUp,NoEcho").Character))
  366. {
  367. write-host "Installation script terminated by user."
  368. $key = $Host.UI.RawUI.ReadKey("NoEcho, IncludeKeyDown")
  369. if ($key.Character -eq "N") { break; }
  370. }
  371. }