# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay
# Bounds accessible via $Resolution.Height, $Resolution.Width
$Resolution = Convert-AspectRatio -Width $Display.Bounds.Width -Height $Display.Bounds.Height -AspectRatio (4 / 3)
Write-ReplaceContentInFile -Pattern '^DATAPATH=(.+)' -Substitution "DATAPATH=$InstallDirectory" -FilePath "$InstallDirectory\TH2_OPT.CFG"
Write-ReplaceContentInFile -Pattern '^MUSPATH=(.+)' -Substitution "MUSPATH=$InstallDirectory\Music" -FilePath "$InstallDirectory\TH2_OPT.CFG"
Write-ReplaceContentInFile -Pattern '^MOVPATH=(.+)' -Substitution "MOVPATH=$InstallDirectory\Movies" -FilePath "$InstallDirectory\TH2_OPT.CFG"
Write-ReplaceContentInFile -Pattern 'h:(\d+), v:(\d+)' -Substitution "h:$($Resolution.Width), v:$($Resolution.Height)" -FilePath "$InstallDirectory\dgVoodoo.conf"
Write-ReplaceContentInFile -Pattern '^NAME=(.+)' -Substitution "NAME=$NewPlayerAlias" -FilePath "$InstallDirectory\TH2_OPT.CFG"