Command & Conquer: Red Alert: Difference between revisions

From LANCommander
(Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Release Date = {{Game.InfoBox.ReleaseDate|Windows|November 22, 1996}} | PCGamingWiki = Command_%26_Conquer:_Red_Alert }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = RA1MPLauncher.exe|Arguments = |WorkingDirectory = |Primary = True}} }} {{Game.Scripts.NameChange |Name = Name Change Script |Description = |RequiresAdmin = False |Contents = <syntaxhighlight lang="powershell" line> $NewName = $a...")
 
(Fixes to deprecated PowerShell scripts)
Line 2: Line 2:
{{Game.InfoBox
{{Game.InfoBox
|Cover = cover.jpg
|Cover = cover.jpg
|Developers =
{{Game.InfoBox.Developer|Westwood Studios}}
|Publishers =
{{Game.InfoBox.Developer|Sold Out Sales &amp; Marketing}}{{Game.InfoBox.Developer|Virgin Interactive Entertainment}}{{Game.InfoBox.Developer|Dice Multi Media Europ}}{{Game.InfoBox.Developer|Sony Computer Entertainment}}{{Game.InfoBox.Developer|Electronic Arts}}
|Release Date =
|Release Date =
{{Game.InfoBox.ReleaseDate|Windows|November 22, 1996}}
{{Game.InfoBox.ReleaseDate|Windows|November 22, 1996}}
| PCGamingWiki = Command_%26_Conquer:_Red_Alert
|Genres =
}}
{{Game.InfoBox.Genre|Real Time Strategy (RTS)}}{{Game.InfoBox.Genre|Strategy}}
|PCGamingWiki = Command_%26_Conquer:_Red_Alert}}


{{Game.ActionBox
{{Game.ActionBox
|Actions =  
|Actions =  
{{Game.ActionBox.Row|Name = Play|Path = RA1MPLauncher.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\RA1MPLauncher.exe|Arguments = |WorkingDirectory = |Primary = True}}
}}
}}


{{Game.Scripts.NameChange
{{Game.Scripts.NameChange
Line 16: Line 22:
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$NewName = $args[0]
<syntaxhighlight lang="powershell" line>
$InstallDir = $PSScriptRoot
Write-ReplaceContentInFile -Pattern '^Nickname=(.+)' -Substitution "Nickname=$NewPlayerAlias" -FilePath "$InstallDirectory\cncnet5.ini"
 
function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}
 
Write-ReplaceContentInFile -Regex '^Nickname=(.+)' -Replacement "Nickname=$NewName" -FilePath "$InstallDir\cncnet5.ini"
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Revision as of 02:05, 6 January 2024

Developers
Westwood Studios
Publishers
Sold Out Sales & MarketingVirgin Interactive EntertainmentDice Multi Media EuropSony Computer EntertainmentElectronic Arts
Release Date
Windows: November 22, 1996
Genres
Real Time Strategy (RTS)Strategy
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play {InstallDir}\RA1MPLauncher.exe True

Name Change Script

Write-ReplaceContentInFile -Pattern '^Nickname=(.+)' -Substitution "Nickname=$NewPlayerAlias" -FilePath "$InstallDirectory\cncnet5.ini"