Wolfenstein: Enemy Territory

From LANCommander
Revision as of 21:58, 8 January 2024 by DoctorDalek (talk | contribs) (Created new page for Wolfenstein: Enemy Territory)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
Splash Damage
Publishers
id SoftwareActivision
Release Date
Windows: May 29, 2003
Genres
Shooter
View at PCGamingWiki

Actions

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

Uninstall Script

$Documents = [Environment]::GetFolderPath('MyDocuments')

Remove-Item "$Documents\ETLegacy" -Recurse -ErrorAction Ignore

Name Change Script

$Documents = [Environment]::GetFolderPath('MyDocuments')

$NewPlayerAlias = $NewPlayerAlias.Split([IO.Path]::GetInvalidFileNameChars()) -join '_'
$OldPlayerAlias = $OldPlayerAlias.Split([IO.Path]::GetInvalidFileNameChars()) -join '_'

if ((Test-Path -Path "$Documents\ETLegacy\legacy\profiles\$OldPlayerAlias") -And ($OldPlayerAlias -ne $NewPlayerAlias)) {
    Rename-Item "$Documents\ETLegacy\legacy\profiles\$OldPlayerAlias" "$NewPlayerAlias"
} else {
    Copy-Item -Path "$InstallDirectory\profile" -Destination "$Documents\ETLegacy" -Recurse
    Rename-Item "$Documents\ETLegacy\legacy\profiles\DoctorDalek" "$NewPlayerAlias"
}

Write-ReplaceContentInFile -Pattern '^seta name "(.+)"' -Substitution "seta name ""$NewPlayerAlias""" -FilePath "$Documents\ETLegacy\legacy\profiles\$NewPlayerAlias\etconfig.cfg"

"""$NewPlayerAlias""" | Out-File -FilePath "$Documents\ETLegacy\legacy\profiles\defaultprofile.dat" -Encoding ASCII -NoNewLine
"""$NewPlayerAlias""" | Out-File -FilePath "$Documents\ETLegacy\legacy\profiles\$NewPlayerAlias\profile.dat" -Encoding ASCII -NoNewLine