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.

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