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.

484 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. 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. #This file will conflict with windows-d2-make-modstrings.patch
  207. Remove-Item .\data\windows\windows-ra2-make-modstrings.patch -Force -ErrorAction SilentlyContinue
  208. } else {
  209. Copy-Item ".\data\patches\windows\*.patch" ".\data\windows"
  210. if ($hotfixes -eq "y") {
  211. Copy-Item ".\data\hotfixes\windows\*.patch" ".\data\windows"
  212. }
  213. #Remove Dune 2 patches
  214. Remove-Item .\data\windows\windows-d2*.patch -Force -ErrorAction SilentlyContinue
  215. }
  216. Start-Sleep -s 3
  217. #Start patching operation
  218. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  219. "`nPatching OpenRA source code for Tiberian Sun & Red Alert 2 + Dune 2."
  220. } else {
  221. "`nPatching OpenRA source code for Tiberian Sun & Red Alert 2."
  222. }
  223. cd .\data\windows
  224. "`nFor each time a patch/hotfix is being applied, UAC may ask permission for patch.exe."
  225. $patchcount = (Get-Childitem .\ | where {$_.extension -eq ".patch"} | Measure-Object ).Count;
  226. Write-Output "`nExecuting patch.exe $patchcount times now."
  227. Start-Sleep -s 6
  228. Get-ChildItem .\ -include *.patch -recurse | Foreach ($_) {.\patch.exe -d OpenRA-bleed -Np1 -i $_.fullname }
  229. cd ..
  230. cd ..
  231. #------------------------------------------------------
  232. ## Push version numbers to mod files
  233. # Red Alert
  234. (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
  235. # Tiberian Dawn
  236. (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
  237. # Dune 2K
  238. (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
  239. # Tiberian Sun
  240. (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
  241. # Red Alert 2
  242. (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
  243. # Mod Chooser
  244. (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
  245. # All
  246. (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
  247. #Dune 2
  248. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  249. (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
  250. }
  251. #------------------------------------------------------
  252. ## Remove temporary files
  253. Remove-Item .\data\windows\*.html
  254. Remove-Item .\data\windows\*.txt
  255. Remove-Item .\data\windows\*.zip
  256. Remove-Item .\data\windows\*.patch
  257. #------------------------------------------------------
  258. ## Compile OpenRA with Tiberian Sun & Red Alert 2
  259. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  260. "`nCompiling OpenRA with Tiberian Sun & Red Alert 2 + Dune 2.`n"
  261. } else {
  262. "`nCompiling OpenRA with Tiberian Sun & Red Alert 2.`n"
  263. }
  264. cd .\data\windows\OpenRA-bleed\
  265. .\make.cmd dependencies
  266. .\make.cmd all
  267. cd ..
  268. cd ..
  269. cd ..
  270. "`nCopying OpenRA files to the final location. This takes a while. Please wait.`n"
  271. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Platforms.Default
  272. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.Common
  273. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.Cnc
  274. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.D2k
  275. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.RA
  276. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.TS
  277. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.RA2
  278. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Server
  279. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Test
  280. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Utility
  281. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.GameMonitor
  282. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Game
  283. Remove-Item -Recurse .\data\windows\OpenRA-bleed\packaging
  284. Remove-Item -Recurse .\data\windows\OpenRA-bleed\thirdparty
  285. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  286. Remove-Item -Recurse .\data\windows\OpenRA-bleed\OpenRA.Mods.D2
  287. }
  288. Remove-Item .\data\windows\OpenRA-bleed\.editorconfig
  289. Remove-Item .\data\windows\OpenRA-bleed\.gitattributes
  290. Remove-Item .\data\windows\OpenRA-bleed\.gitignore
  291. Remove-Item .\data\windows\OpenRA-bleed\.kateproject
  292. Remove-Item .\data\windows\OpenRA-bleed\.travis.yml
  293. Remove-Item .\data\windows\OpenRA-bleed\CONTRIBUTING.md
  294. Remove-Item .\data\windows\OpenRA-bleed\COPYING
  295. Remove-Item .\data\windows\OpenRA-bleed\ConvertFrom-Markdown.ps1
  296. Remove-Item .\data\windows\OpenRA-bleed\INSTALL.md
  297. Remove-Item .\data\windows\OpenRA-bleed\Makefile
  298. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.sln
  299. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.sln.orig
  300. Remove-Item .\data\windows\OpenRA-bleed\README.md
  301. Remove-Item .\data\windows\OpenRA-bleed\Settings.StyleCop
  302. Remove-Item .\data\windows\OpenRA-bleed\make.ps1
  303. Remove-Item .\data\windows\OpenRA-bleed\make.ps1.orig
  304. Remove-Item .\data\windows\OpenRA-bleed\make.cmd
  305. Remove-Item .\data\windows\OpenRA-bleed\launch-game.sh
  306. Remove-Item .\data\windows\OpenRA-bleed\launch-dedicated.sh
  307. Remove-Item .\data\windows\OpenRA-bleed\appveyor.yml
  308. Remove-Item .\data\windows\OpenRA-bleed\dupFinder.xslt
  309. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Game.pdb
  310. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Server.pdb
  311. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Platforms.Default.pdb
  312. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Test.nunit
  313. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Test.pdb
  314. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.pdb
  315. Remove-Item .\data\windows\OpenRA-bleed\OpenRA.Utility.pdb
  316. Remove-Item .\data\windows\OpenRA-bleed\AUTHORS
  317. Remove-Item .\data\windows\OpenRA-bleed\mods\cnc\OpenRA.Mods.Cnc.pdb
  318. Remove-Item .\data\windows\OpenRA-bleed\mods\common\OpenRA.Mods.Common.pdb
  319. Remove-Item .\data\windows\OpenRA-bleed\mods\d2k\OpenRA.Mods.D2k.pdb
  320. Remove-Item .\data\windows\OpenRA-bleed\mods\ra\OpenRA.Mods.RA.pdb
  321. Remove-Item .\data\windows\OpenRA-bleed\mods\ts\OpenRA.Mods.TS.pdb
  322. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\build.cake
  323. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\makefile
  324. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\make.ps1
  325. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\mod.yaml.orig
  326. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\.gitattributes
  327. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\.gitignore
  328. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\.travis.yml
  329. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\make.cmd
  330. Remove-Item .\data\windows\OpenRA-bleed\mods\ra2\fetch-content.sh
  331. Remove-Item -Recurse .\data\windows\OpenRA-bleed\mods\ra2\OpenRA.Mods.RA2
  332. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  333. Copy-Item -Recurse ".\data\windows\OpenRA-bleed\" ".\OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion-d2$d2_folderversion"
  334. Remove-Item .\data\windows\d2-master
  335. } else {
  336. Copy-Item -Recurse ".\data\windows\OpenRA-bleed\" ".\OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion"
  337. }
  338. Remove-Item .\data\windows\OpenRA-bleed\* -Recurse
  339. Remove-Item .\data\windows\OpenRA-bleed
  340. Remove-Item .\data\windows\ra2-master
  341. #------------------------------------------------------
  342. ## Post-installation messages
  343. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  344. "`nCompilation process completed. You find the game inside 'OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion-d2$d2_folderversion' folder"
  345. } else {
  346. "`nCompilation process completed. You find the game inside 'OpenRA-tibsunra2-Windows-openra$openra_folderversion-ra2$ra2_folderversion' folder"
  347. }
  348. Start-Sleep -s 4
  349. "`nTO PLAY OPENRA: Click OpenRA.exe (maybe you should create a desktop shortcut for it?)"
  350. "`nTO PLAY TIBERIAN SUN: Launch the game and download the required asset files from the web when the game asks you to do so."
  351. "`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)"
  352. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  353. "`nTO PLAY DUNE 2: Please see https://github.com/Fincer/openra-tibsunra2/ front page for further instructions."
  354. }
  355. "`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."
  356. "`nFor this compilation, the version numbers are as follows:"
  357. Write-Output "OpenRA version: $openra_gitversion"
  358. Write-Output "RA2 version: $ra2_gitversion"
  359. if (-Not ($dune2_install -eq "n") -and -Not ($dune2_install -eq "o")) {
  360. Write-Output "Dune 2 version: $d2_gitversion"
  361. }
  362. "`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\"
  363. "`nHave fun!"
  364. exit
  365. #------------------------------------------------------
  366. ## Termination code for the script (Ctrl + C)
  367. if ($Host.UI.RawUI.KeyAvailable -and (3 -eq [int]$Host.UI.RawUI.ReadKey("AllowCtrlC,IncludeKeyUp,NoEcho").Character))
  368. {
  369. write-host "Installation script terminated by user."
  370. $key = $Host.UI.RawUI.ReadKey("NoEcho, IncludeKeyDown")
  371. if ($key.Character -eq "N") { break; }
  372. }
  373. }