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
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Games]]
[[Category:Games]]
{{InfoBox.Game
{{Game.InfoBox
|Cover = cover.jpg
|Cover = cover.jpg
|Developers =
|Developers =
{{InfoBox.Game.Developer|Infinity Ward}}
{{Game.InfoBox.Developer|Infinity Ward}}
|Publishers =
|Publishers =
{{InfoBox.Game.Publisher|Activision}}
{{Game.InfoBox.Publisher|Activision}}
|Release Date =
|Release Date =
{{InfoBox.Game.ReleaseDate|Windows|October 29, 2003}}
{{Game.InfoBox.ReleaseDate|Windows|October 29, 2003}}
|Genres =
|Genres =
{{InfoBox.Game.Genre|Shooter}}
{{Game.InfoBox.Genre|Shooter}}
| PCGamingWiki = Call_of_Duty
|PCGamingWiki = Call_of_Duty}}
 
{{Game.ActionBox
|Actions =
{{Game.ActionBox.Row|Name = Call of Duty: United Offensive (Multiplayer)|Path = {InstallDir}\CoDUOMP.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Call of Duty (Multiplayer)|Path = {InstallDir}\CoDMP.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Call of Duty (Singleplayer)|Path = {InstallDir}\CoDSP.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Call of Duty: United Offensive (Singleplayer)|Path = {InstallDir}\CoDUOSP.exe|Arguments = |WorkingDirectory = |Primary = True}}
}}
}}


== Name Change Script ==
 
{{Game.Scripts.Install
|Name = Install Script
|Description =  
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
<syntaxhighlight lang="powershell" line>
$NewName = $args[0]
$Display = Get-PrimaryDisplay
$InstallDir = $PSScriptRoot
$FOV = 80


function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
if (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 9)) {
{
     $FOV = 96.4183
     $content = (Get-Content $FilePath) -replace $Regex, $Replacement
} elseif (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 10)) {
     [IO.File]::WriteAllLines($FilePath, $content)
     $FOV = 90.3951
}
}


Write-ReplaceContentInFile -Regex '^seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\Main\config_mp.cfg"
# Base Game Resolution
Write-ReplaceContentInFile -Regex '^seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\uo\uoconfig_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customheight(.+)' -Substitution "seta r_customheight ""$($Display.Bounds.Height)""" -FilePath "$InstallDirectory\main\config_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customwidth(.+)' -Substitution "seta r_customwidth ""$($Display.Bounds.Width)""" -FilePath "$InstallDirectory\main\config_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_mode(.+)' -Substitution "seta r_mode ""-1""" -FilePath "$InstallDirectory\main\config_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customaspect(.+)' -Substitution "seta r_customaspect ""1.7""" -FilePath "$InstallDirectory\main\config_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta cg_fov(.+)' -Substitution "seta cg_fov ""$FOV""" -FilePath "$InstallDirectory\main\config_mp.cfg"
 
# United Offensive Resolution
Write-ReplaceContentInFile -Pattern '^seta r_customheight(.+)' -Substitution "seta r_customheight ""$($Display.Bounds.Height)""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customwidth(.+)' -Substitution "seta r_customwidth ""$($Display.Bounds.Width)""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_mode(.+)' -Substitution "seta r_mode ""-1""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customaspect(.+)' -Substitution "seta r_customaspect ""1.7""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta cg_fov(.+)' -Substitution "seta cg_fov ""$FOV""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"
 
# Non-destructively creates path in registry
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision"
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive"
 
# Creates or updates a key in the registry
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive" -Name "Version" -Value "1.51" -Force
</syntaxhighlight>
</syntaxhighlight>
 
}}
== Key Change Script ==
           
{{Game.Scripts.Uninstall
|Name = Uninstall Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
Remove-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty" -Force -Recurse
Remove-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive" -Force -Recurse
</syntaxhighlight>
}}
           
{{Game.Scripts.NameChange
|Name = Name Change Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
Write-ReplaceContentInFile -Pattern '^seta name (.+)' -Substitution "seta name ""$NewPlayerAlias""" -FilePath "$InstallDirectory\Main\config_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta name (.+)' -Substitution "seta name ""$NewPlayerAlias""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"
</syntaxhighlight>
}}
           
{{Game.Scripts.KeyChange
|Name = Key Change Script
|Description =  
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
<syntaxhighlight lang="powershell" line>
# Requires Admin
$Key = $AllocatedKey
 
$Key = $args[0]


$Key = $Key.Replace("-", "")
$Key = $Key.Replace("-", "")
Line 39: Line 94:


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


# Creates or updates a key in the registry
# 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 "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\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
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive" -Name "key" -Value $coduokey -Force
</syntaxhighlight>
</syntaxhighlight>
}}

Latest revision as of 00:39, 22 February 2024

Developers
Infinity Ward
Publishers
Activision
Release Date
Windows: October 29, 2003
Genres
Shooter
View at PCGamingWiki

Actions

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

Install Script

$Display = Get-PrimaryDisplay
$FOV = 80

if (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 9)) {
    $FOV = 96.4183
} elseif (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 10)) {
    $FOV = 90.3951
}

# Base Game Resolution
Write-ReplaceContentInFile -Pattern '^seta r_customheight(.+)' -Substitution "seta r_customheight ""$($Display.Bounds.Height)""" -FilePath "$InstallDirectory\main\config_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customwidth(.+)' -Substitution "seta r_customwidth ""$($Display.Bounds.Width)""" -FilePath "$InstallDirectory\main\config_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_mode(.+)' -Substitution "seta r_mode ""-1""" -FilePath "$InstallDirectory\main\config_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customaspect(.+)' -Substitution "seta r_customaspect ""1.7""" -FilePath "$InstallDirectory\main\config_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta cg_fov(.+)' -Substitution "seta cg_fov ""$FOV""" -FilePath "$InstallDirectory\main\config_mp.cfg"

# United Offensive Resolution
Write-ReplaceContentInFile -Pattern '^seta r_customheight(.+)' -Substitution "seta r_customheight ""$($Display.Bounds.Height)""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customwidth(.+)' -Substitution "seta r_customwidth ""$($Display.Bounds.Width)""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_mode(.+)' -Substitution "seta r_mode ""-1""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customaspect(.+)' -Substitution "seta r_customaspect ""1.7""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta cg_fov(.+)' -Substitution "seta cg_fov ""$FOV""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"

# Non-destructively creates path in registry
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision"
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive"

# Creates or updates a key in the registry
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive" -Name "Version" -Value "1.51" -Force

Uninstall Script

Remove-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty" -Force -Recurse
Remove-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive" -Force -Recurse

Name Change Script

Write-ReplaceContentInFile -Pattern '^seta name (.+)' -Substitution "seta name ""$NewPlayerAlias""" -FilePath "$InstallDirectory\Main\config_mp.cfg"
Write-ReplaceContentInFile -Pattern '^seta name (.+)' -Substitution "seta name ""$NewPlayerAlias""" -FilePath "$InstallDirectory\uo\uoconfig_mp.cfg"

Key Change Script

$Key = $AllocatedKey

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

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

# Non-destructively creates path in registry
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision"
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty"
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Activision\Call of Duty United Offensive"

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