Command & Conquer: Generals: Difference between revisions
DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Release Date = {{Game.InfoBox.ReleaseDate|Windows|February 10, 2003}} | PCGamingWiki = Command_%26_Conquer:_Generals }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = generals.exe|Arguments = |WorkingDirectory = |Primary = True}} {{Game.ActionBox.Row|Name = World Builder|Path = WorldBuilder.exe|Arguments = |WorkingDirectory = |Primary = False}} }} {{Game.Scripts.Install |Name = Install Script |...") |
DoctorDalek (talk | contribs) No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
{{Game.InfoBox | {{Game.InfoBox | ||
|Cover = cover.jpg | |Cover = cover.jpg | ||
|Developers = | |||
{{Game.InfoBox.Developer|EA Pacific}} | |||
|Publishers = | |||
{{Game.InfoBox.Publisher|Electronic Arts}}{{Game.InfoBox.Publisher|Aspyr Media}} | |||
|Release Date = | |Release Date = | ||
{{Game.InfoBox.ReleaseDate|Windows|February 10, 2003}} | {{Game.InfoBox.ReleaseDate|Windows|February 10, 2003}} | ||
| PCGamingWiki = Command_%26_Conquer:_Generals | |Genres = | ||
}} | {{Game.InfoBox.Genre|Real Time Strategy (RTS)}}{{Game.InfoBox.Genre|Strategy}} | ||
|PCGamingWiki = Command_%26_Conquer:_Generals}} | |||
{{Game.ActionBox | {{Game.ActionBox | ||
|Actions = | |Actions = | ||
{{Game.ActionBox.Row|Name = Play|Path = generals.exe|Arguments = |WorkingDirectory = |Primary = True}} | {{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\generals.exe|Arguments = |WorkingDirectory = |Primary = True}} | ||
{{Game.ActionBox.Row|Name = World Builder|Path = WorldBuilder.exe|Arguments = |WorkingDirectory = |Primary = False}} | {{Game.ActionBox.Row|Name = World Builder|Path = {InstallDir}\WorldBuilder.exe|Arguments = |WorkingDirectory = |Primary = False}} | ||
}} | }} | ||
{{Game.Scripts.Install | {{Game.Scripts.Install | ||
|Name = Install Script | |Name = Install Script | ||
|Description = | |Description = | ||
|RequiresAdmin = | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang="powershell" line> | |Contents = | ||
<syntaxhighlight lang="powershell" line> | |||
$Key = $ | $Key = $AllocatedKey -Replace "-", "" | ||
$Documents = [Environment]::GetFolderPath('MyDocuments') | |||
# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height | |||
$Display = Get-PrimaryDisplay | |||
$X = $Display.Bounds.Width | |||
$Y = $Display.Bounds.Height | |||
$ | $VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE" | ||
$GeneralsPath = "$VirtualStore\WOW6432Node\Electronic Arts\EA Games\Generals" | |||
New-Item -Path "$GeneralsPath" -Force | New-Item -Path "$GeneralsPath" -Force | ||
New-Item -Path "$GeneralsPath\ergc" -Force | New-Item -Path "$GeneralsPath\ergc" -Force | ||
New-ItemProperty -Path "$GeneralsPath" -Name "InstallPath" -Value "$ | New-ItemProperty -Path "$GeneralsPath" -Name "InstallPath" -Value "$InstallDirectory\" | ||
New-ItemProperty -Path "$GeneralsPath" -Name "Language" -Value "english" | New-ItemProperty -Path "$GeneralsPath" -Name "Language" -Value "english" | ||
New-ItemProperty -Path "$GeneralsPath" -Name "MapPackVersion" -Value 65536 | New-ItemProperty -Path "$GeneralsPath" -Name "MapPackVersion" -Value 65536 | ||
Line 44: | Line 46: | ||
Set-ItemProperty -Path "$GeneralsPath\ergc" -Name "(Default)" -Value $Key | Set-ItemProperty -Path "$GeneralsPath\ergc" -Name "(Default)" -Value $Key | ||
Copy-Item -Path "$ | Copy-Item -Path "$InstallDirectory\ProfileTemplate" -Destination "$Documents\Command and Conquer Generals Data" -Recurse | ||
Write-ReplaceContentInFile - | Write-ReplaceContentInFile -Pattern '^Resolution = (.+)' -Substitution "Resolution = $X $Y" -FilePath "$Documents\Command and Conquer Generals Data\options.ini" | ||
Remove-Item -Force "$InstallDirectory\Data\Movies\EA_LOGO.BIK" | |||
Remove-Item -Force "$InstallDirectory\Data\Movies\EA_LOGO640.BIK" | |||
Remove-Item -Force "$InstallDirectory\Data\Movies\sizzle_review.bik" | |||
Remove-Item -Force "$InstallDirectory\Data\Movies\sizzle_review640.bik" | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
{{Game.Scripts.Uninstall | |||
|Name = Uninstall Script | |||
|Description = | |||
|RequiresAdmin = False | |||
|Contents = | |||
<syntaxhighlight lang="powershell" line> | |||
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE" | |||
$GeneralsPath = "$VirtualStore\WOW6432Node\Electronic Arts\EA Games\Generals" | |||
$Documents = [Environment]::GetFolderPath('MyDocuments') | |||
Remove-Item -Path "$GeneralsPath" -Recurse -Force | |||
Remove-Item -Path "$Documents\Command and Conquer Generals Data" -Recurse -Force | |||
</syntaxhighlight> | |||
}} | |||
{{Game.Scripts.NameChange | {{Game.Scripts.NameChange | ||
|Name = Name Change Script | |Name = Name Change Script | ||
|Description = | |Description = | ||
|RequiresAdmin = False | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang="powershell" line> | |Contents = | ||
$ | <syntaxhighlight lang="powershell" line> | ||
$Documents = [Environment]::GetFolderPath('MyDocuments') | |||
if ($ | if ($NewPlayerAlias.Length -gt 11) { | ||
$ | $NewPlayerAlias = $NewPlayerAlias.Substring(0, 11); | ||
} | } | ||
$NetworkPrefsFormattedName = "" | $NetworkPrefsFormattedName = "" | ||
foreach ($character in $ | foreach ($character in $NewPlayerAlias.ToCharArray()) { | ||
$NetworkPrefsFormattedName = $NetworkPrefsFormattedName + $character + "_00" | $NetworkPrefsFormattedName = $NetworkPrefsFormattedName + $character + "_00" | ||
} | } | ||
Line 69: | Line 92: | ||
$NetworkPrefsIni = "UserName = $NetworkPrefsFormattedName" | $NetworkPrefsIni = "UserName = $NetworkPrefsFormattedName" | ||
New-Item -ItemType Directory -Force -Path "$ | New-Item -ItemType Directory -Force -Path "$Documents\Command and Conquer Generals Data" | ||
Set-Content "$ | Set-Content "$Documents\Command and Conquer Generals Data\Network.ini" $NetworkPrefsIni | ||
$SkirmishIni = @" | $SkirmishIni = @" | ||
Line 82: | Line 105: | ||
"@ | "@ | ||
Set-Content "$ | Set-Content "$Documents\Command and Conquer Generals Data\Skirmish.ini" $SkirmishIni | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
{{Game.Scripts.KeyChange | {{Game.Scripts.KeyChange | ||
|Name = Key Change Script | |Name = Key Change Script | ||
|Description = | |Description = | ||
|RequiresAdmin = | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang="powershell" line> | |Contents = | ||
$ | <syntaxhighlight lang="powershell" line> | ||
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE" | |||
$GeneralsPath = "$VirtualStore\WOW6432Node\Electronic Arts\EA Games\Generals" | |||
$Key = $ | $Key = $AllocatedKey -Replace "-", "" | ||
Set-ItemProperty -Path "$GeneralsPath\ergc" -Name "(Default)" -Value $Key | Set-ItemProperty -Path "$GeneralsPath\ergc" -Name "(Default)" -Value $Key | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} |
Latest revision as of 19:58, 12 March 2024
Developers | |
---|---|
EA Pacific | |
Publishers | |
Electronic ArtsAspyr Media | |
Release Date | |
Windows: February 10, 2003 | |
Genres | |
Real Time Strategy (RTS)Strategy | |
View at PCGamingWiki |
Actions
Name | Path | Arguments | Working Directory | Primary |
---|---|---|---|---|
Play | {InstallDir}\generals.exe | True | ||
World Builder | {InstallDir}\WorldBuilder.exe | False |
Install Script
$Key = $AllocatedKey -Replace "-", ""
$Documents = [Environment]::GetFolderPath('MyDocuments')
# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay
$X = $Display.Bounds.Width
$Y = $Display.Bounds.Height
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE"
$GeneralsPath = "$VirtualStore\WOW6432Node\Electronic Arts\EA Games\Generals"
New-Item -Path "$GeneralsPath" -Force
New-Item -Path "$GeneralsPath\ergc" -Force
New-ItemProperty -Path "$GeneralsPath" -Name "InstallPath" -Value "$InstallDirectory\"
New-ItemProperty -Path "$GeneralsPath" -Name "Language" -Value "english"
New-ItemProperty -Path "$GeneralsPath" -Name "MapPackVersion" -Value 65536
New-ItemProperty -Path "$GeneralsPath" -Name "Version" -Value 65544
Set-ItemProperty -Path "$GeneralsPath\ergc" -Name "(Default)" -Value $Key
Copy-Item -Path "$InstallDirectory\ProfileTemplate" -Destination "$Documents\Command and Conquer Generals Data" -Recurse
Write-ReplaceContentInFile -Pattern '^Resolution = (.+)' -Substitution "Resolution = $X $Y" -FilePath "$Documents\Command and Conquer Generals Data\options.ini"
Remove-Item -Force "$InstallDirectory\Data\Movies\EA_LOGO.BIK"
Remove-Item -Force "$InstallDirectory\Data\Movies\EA_LOGO640.BIK"
Remove-Item -Force "$InstallDirectory\Data\Movies\sizzle_review.bik"
Remove-Item -Force "$InstallDirectory\Data\Movies\sizzle_review640.bik"
Uninstall Script
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE"
$GeneralsPath = "$VirtualStore\WOW6432Node\Electronic Arts\EA Games\Generals"
$Documents = [Environment]::GetFolderPath('MyDocuments')
Remove-Item -Path "$GeneralsPath" -Recurse -Force
Remove-Item -Path "$Documents\Command and Conquer Generals Data" -Recurse -Force
Name Change Script
$Documents = [Environment]::GetFolderPath('MyDocuments')
if ($NewPlayerAlias.Length -gt 11) {
$NewPlayerAlias = $NewPlayerAlias.Substring(0, 11);
}
$NetworkPrefsFormattedName = ""
foreach ($character in $NewPlayerAlias.ToCharArray()) {
$NetworkPrefsFormattedName = $NetworkPrefsFormattedName + $character + "_00"
}
$NetworkPrefsIni = "UserName = $NetworkPrefsFormattedName"
New-Item -ItemType Directory -Force -Path "$Documents\Command and Conquer Generals Data"
Set-Content "$Documents\Command and Conquer Generals Data\Network.ini" $NetworkPrefsIni
$SkirmishIni = @"
Color = -1
FPS = 30
Map = maps\alpine assault\alpine assault.map
PlayerTemplate = -1
SlotList = M=03maps/alpine assault;MC=B7E74B8C;MS=275524;SD=71090984;C=100;S=HPats-Desktop,0,0,TT,-1,-1,-1,-1,1:CE,-1,-1,-1,-1:O:O:O:O:O:O:;
UserName = $NetworkPrefsFormattedName
"@
Set-Content "$Documents\Command and Conquer Generals Data\Skirmish.ini" $SkirmishIni
Key Change Script
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE"
$GeneralsPath = "$VirtualStore\WOW6432Node\Electronic Arts\EA Games\Generals"
$Key = $AllocatedKey -Replace "-", ""
Set-ItemProperty -Path "$GeneralsPath\ergc" -Name "(Default)" -Value $Key