Call of Duty: Difference between revisions

From LANCommander
(Created page with "Category:Games {{InfoBox.Game |Cover = cover.jpg |Developers = {{InfoBox.Game.Developer|Infinity Ward}} |Publishers = {{InfoBox.Game.Publisher|Activision}} |Release Date = {{InfoBox.Game.ReleaseDate|Windows|October 29, 2003}} |Genres = {{InfoBox.Game.Genre|Shooter}} | PCGamingWiki = Call_of_Duty }} == Name Change Script == <syntaxhighlight lang="powershell" line> $NewName = $args[0] $InstallDir = $PSScriptRoot function Write-ReplaceContentInFile([string]$Regex, [st...")
 
No edit summary
Line 1: Line 1:
[[Category:Games]]
[[Category:Games]]
{{InfoBox.Game
{{Game.InfoBox
|Cover = cover.jpg
|Cover = cover.jpg
|Developers =
{{InfoBox.Game.Developer|Infinity Ward}}
|Publishers =
{{InfoBox.Game.Publisher|Activision}}
|Release Date =
|Release Date =
{{InfoBox.Game.ReleaseDate|Windows|October 29, 2003}}
{{Game.InfoBox.ReleaseDate|Windows|October 29, 2003}}
|Genres =
{{InfoBox.Game.Genre|Shooter}}
| PCGamingWiki = Call_of_Duty
| PCGamingWiki = Call_of_Duty
}}
}}


== Name Change Script ==
{{Game.ActionBox
<syntaxhighlight lang="powershell" line>
|Actions =
{{Game.ActionBox.Row|Name = Call of Duty: United Offensive (Multiplayer)|Path = CoDUOMP.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Call of Duty (Multiplayer)|Path = CoDMP.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Call of Duty (Singleplayer)|Path = CoDSP.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Call of Duty: United Offensive (Singleplayer)|Path = CoDUOSP.exe|Arguments = |WorkingDirectory = |Primary = True}}
}}
 
{{Game.SaveBox
|Paths =
{{Game.SaveBox.Row|Type = Registry|Path = HKLM:\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive}}
{{Game.SaveBox.Row|Type = Registry|Path = HKLM:\SOFTWARE\WOW6432Node\Activision\Call of Duty}}
{{Game.SaveBox.Row|Type = File|Path = {InstallDir}/Main/config_mp.cfg}}
{{Game.SaveBox.Row|Type = File|Path = {InstallDir}/uo/uoconfig_mp.cfg}}
}}
 
{{Game.Scripts.NameChange
|Name = Name Change Script
|Description =  
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
$NewName = $args[0]
$NewName = $args[0]
$InstallDir = $PSScriptRoot
$InstallDir = $PSScriptRoot
Line 27: Line 40:
Write-ReplaceContentInFile -Regex '^seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\uo\uoconfig_mp.cfg"
Write-ReplaceContentInFile -Regex '^seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\uo\uoconfig_mp.cfg"
</syntaxhighlight>
</syntaxhighlight>
}}


== Key Change Script ==
{{Game.Scripts.KeyChange
<syntaxhighlight lang="powershell" line>
|Name = Key Change Script
|Description =  
|RequiresAdmin = True
|Contents = <syntaxhighlight lang="powershell" line>
# Requires Admin
# Requires Admin


Line 47: Line 64:
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive" -Name "key" -Value $coduokey -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive" -Name "key" -Value $coduokey -Force
</syntaxhighlight>
</syntaxhighlight>
}}

Revision as of 06:55, 31 July 2023

Release Date
Windows: October 29, 2003
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Call of Duty: United Offensive (Multiplayer) CoDUOMP.exe True
Call of Duty (Multiplayer) CoDMP.exe True
Call of Duty (Singleplayer) CoDSP.exe True
Call of Duty: United Offensive (Singleplayer) CoDUOSP.exe True

Save Paths

Type Path
Registry HKLM:\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive
Registry HKLM:\SOFTWARE\WOW6432Node\Activision\Call of Duty
File {InstallDir}/Main/config_mp.cfg
File {InstallDir}/uo/uoconfig_mp.cfg

Name Change Script

$NewName = $args[0]
$InstallDir = $PSScriptRoot

function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}

Write-ReplaceContentInFile -Regex '^seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\Main\config_mp.cfg"
Write-ReplaceContentInFile -Regex '^seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\uo\uoconfig_mp.cfg"

Key Change Script

This script requires admin access to function properly

# Requires Admin

$Key = $args[0]

$Key = $Key.Replace("-", "")

$codkey, $coduokey = $Key -Split ',',2

# Non-destructively creates path in registry
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Activision"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Activision\Call of Duty"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive"

# Creates or updates a key in the registry
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Activision\Call of Duty" -Name "codkey" -Value $codkey -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive" -Name "key" -Value $coduokey -Force