Unreal Tournament 2004: Difference between revisions

From LANCommander
(Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Epic Games}} |Publishers = {{Game.InfoBox.Publisher|Epic Games}} {{Game.InfoBox.Publisher|MacSoft Games}} {{Game.InfoBox.Publisher|Atari}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|March 16, 2004}} |Genres = {{Game.InfoBox.Genre|Shooter}} | PCGamingWiki = Unreal_Tournament_2004 }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = System/UT2004.exe|Argu...")
 
No edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 5: Line 5:
{{Game.InfoBox.Developer|Epic Games}}
{{Game.InfoBox.Developer|Epic Games}}
|Publishers =
|Publishers =
{{Game.InfoBox.Publisher|Epic Games}}
{{Game.InfoBox.Publisher|Atari, Inc.}}{{Game.InfoBox.Publisher|Epic Games}}{{Game.InfoBox.Publisher|MacSoft Games}}
{{Game.InfoBox.Publisher|MacSoft Games}}
{{Game.InfoBox.Publisher|Atari}}
|Release Date =
|Release Date =
{{Game.InfoBox.ReleaseDate|Windows|March 16, 2004}}
{{Game.InfoBox.ReleaseDate|Windows|March 16, 2004}}
|Genres =
|Genres =
{{Game.InfoBox.Genre|Shooter}}
{{Game.InfoBox.Genre|Shooter}}
| PCGamingWiki = Unreal_Tournament_2004
|PCGamingWiki = Unreal_Tournament_2004}}
}}


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


{{Game.Scripts.NameChange
 
|Name = Name Change Script
{{Game.Scripts.Install
|Name = Install Script
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$NewName = $args[0]
<syntaxhighlight lang="powershell" line>
$InstallDir = $PSScriptRoot
# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay
 
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^FullscreenViewportX=(.+)' -Substitution "FullscreenViewportX=$($Display.Bounds.Width)" -FilePath "$InstallDirectory\System\UT2004.ini"
Write-ReplaceContentInFile -Pattern '^FullscreenViewportY=(.+)' -Substitution "FullscreenViewportY=$($Display.Bounds.Height)" -FilePath "$InstallDirectory\System\UT2004.ini"
 
# Might need to set FOV
$FOV = 90


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


Write-ReplaceContentInFile -Regex 'Name=(.+)' -Replacement "Name=$NewName" -FilePath "$InstallDir\System\User.ini"
Write-ReplaceContentInFile -Pattern '^DesiredFOV=(.+)' -Substitution "DesiredFOV=$FOV" -FilePath "$InstallDirectory\System\UT2004.ini"
Write-ReplaceContentInFile -Pattern '^DefaultFOV=(.+)' -Substitution "DefaultFOV=$FOV" -FilePath "$InstallDirectory\System\UT2004.ini"
Write-ReplaceContentInFile -Pattern '^FOVAngle=(.+)' -Substitution "DefaultFOV=$FOV.0" -FilePath "$InstallDirectory\System\UT2004.ini"
 
# Turns off Gamespy Stats & Replaces utmaster servers
Write-ReplaceContentInFile -Pattern '^UplinkToGamespy=(.+)' -Substitution "UplinkToGamespy=False" -FilePath "$InstallDirectory\System\UT2004.ini"
Write-ReplaceContentInFile -Pattern '^MasterServerList=(Address="ut2004master1.epicgames.com",Port=28902' -Substitution 'MasterServerList=(Address="utmaster.openspy.net",Port=28902' -FilePath "$InstallDirectory\System\UT2004.ini"
Write-ReplaceContentInFile -Pattern '^MasterServerList=(Address="ut2004master2.epicgames.com",Port=28902' -Substitution 'MasterServerList=(Address="ut2004master.333networks.com",Port=28902' -FilePath "$InstallDirectory\System\UT2004.ini"
 
$VirtualStore = "registry::\HKEY_LOCAL_MACHINE\SOFTWARE"
 
# Creates or updates a key in the registry
# Non-destructively creates path in registry
New-Item -Path "$VirtualStore\WOW6432Node\Unreal Technology"
New-Item -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps"
 
New-Item -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004"
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "Version" -Value "1" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "CDKey" -Value "3QHVC-DHA9K-A84RE-KYRT4" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "ADMIN_RIGHTS" -Value "You need to run this program as an administrator, not as a guest or limited user account." -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "NO_DISC" -Value "No disc in drive.  Please insert the disc labeled 'Unreal Tournament 2004 Play Disc' to continue." -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "NO_DRIVE" -Value "No CD-ROM or DVD-ROM drive detected." -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "TITLEBAR" -Value "Unreal Tournament 2004" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "WRONG_DISC" -Value "Wrong disc in drive.  Please insert the disc labeled 'Unreal Tournament 2004 Play Disc' to continue." -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "YEAR" -Value "2004" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "Folder" -Value "$InstallDirectory" -Force
 
Start-Sleep 10
</syntaxhighlight>
}}
           
{{Game.Scripts.Uninstall
|Name = Uninstall Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
$VirtualStore = "Registry::\HKEY_LOCAL_MACHINE\SOFTWARE"
 
Remove-Item -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Force -Recurse
</syntaxhighlight>
}}
 
{{Game.Scripts.KeyChange
|Name = Key Change Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
$VirtualStore = "Registry::\HKEY_LOCAL_MACHINE\SOFTWARE"
 
New-ItemProperty -Path "$VirtualStore\Wow6432Node\Unreal Technology\Installed Apps\UT2004" -Name "CDKey" -Value "$AllocatedKey" -Force
</syntaxhighlight>
}}
           
{{Game.Scripts.NameChange
|Name = Name Change Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
Write-ReplaceContentInFile -Pattern 'Name=(.+)' -Substitution "Name=$NewPlayerAlias" -FilePath "$InstallDirectory\System\User.ini"
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 14:05, 5 September 2024

Developers
Epic Games
Publishers
Atari, Inc.Epic GamesMacSoft Games
Release Date
Windows: March 16, 2004
Genres
Shooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play {InstallDir}\System/UT2004.exe True

Install Script

# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay

# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^FullscreenViewportX=(.+)' -Substitution "FullscreenViewportX=$($Display.Bounds.Width)" -FilePath "$InstallDirectory\System\UT2004.ini"
Write-ReplaceContentInFile -Pattern '^FullscreenViewportY=(.+)' -Substitution "FullscreenViewportY=$($Display.Bounds.Height)" -FilePath "$InstallDirectory\System\UT2004.ini"

# Might need to set FOV
$FOV = 90

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

Write-ReplaceContentInFile -Pattern '^DesiredFOV=(.+)' -Substitution "DesiredFOV=$FOV" -FilePath "$InstallDirectory\System\UT2004.ini"
Write-ReplaceContentInFile -Pattern '^DefaultFOV=(.+)' -Substitution "DefaultFOV=$FOV" -FilePath "$InstallDirectory\System\UT2004.ini"
Write-ReplaceContentInFile -Pattern '^FOVAngle=(.+)' -Substitution "DefaultFOV=$FOV.0" -FilePath "$InstallDirectory\System\UT2004.ini"

# Turns off Gamespy Stats & Replaces utmaster servers
Write-ReplaceContentInFile -Pattern '^UplinkToGamespy=(.+)' -Substitution "UplinkToGamespy=False" -FilePath "$InstallDirectory\System\UT2004.ini"
Write-ReplaceContentInFile -Pattern '^MasterServerList=(Address="ut2004master1.epicgames.com",Port=28902' -Substitution 'MasterServerList=(Address="utmaster.openspy.net",Port=28902' -FilePath "$InstallDirectory\System\UT2004.ini"
Write-ReplaceContentInFile -Pattern '^MasterServerList=(Address="ut2004master2.epicgames.com",Port=28902' -Substitution 'MasterServerList=(Address="ut2004master.333networks.com",Port=28902' -FilePath "$InstallDirectory\System\UT2004.ini"

$VirtualStore = "registry::\HKEY_LOCAL_MACHINE\SOFTWARE"

# Creates or updates a key in the registry
# Non-destructively creates path in registry
New-Item -Path "$VirtualStore\WOW6432Node\Unreal Technology"
New-Item -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps"

New-Item -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004"
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "Version" -Value "1" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "CDKey" -Value "3QHVC-DHA9K-A84RE-KYRT4" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "ADMIN_RIGHTS" -Value "You need to run this program as an administrator, not as a guest or limited user account." -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "NO_DISC" -Value "No disc in drive.  Please insert the disc labeled 'Unreal Tournament 2004 Play Disc' to continue." -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "NO_DRIVE" -Value "No CD-ROM or DVD-ROM drive detected." -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "TITLEBAR" -Value "Unreal Tournament 2004" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "WRONG_DISC" -Value "Wrong disc in drive.  Please insert the disc labeled 'Unreal Tournament 2004 Play Disc' to continue." -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "YEAR" -Value "2004" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Name "Folder" -Value "$InstallDirectory" -Force

Start-Sleep 10

Uninstall Script

$VirtualStore = "Registry::\HKEY_LOCAL_MACHINE\SOFTWARE"

Remove-Item -Path "$VirtualStore\WOW6432Node\Unreal Technology\Installed Apps\UT2004" -Force -Recurse

Key Change Script

$VirtualStore = "Registry::\HKEY_LOCAL_MACHINE\SOFTWARE"

New-ItemProperty -Path "$VirtualStore\Wow6432Node\Unreal Technology\Installed Apps\UT2004" -Name "CDKey" -Value "$AllocatedKey" -Force

Name Change Script

Write-ReplaceContentInFile -Pattern 'Name=(.+)' -Substitution "Name=$NewPlayerAlias" -FilePath "$InstallDirectory\System\User.ini"