# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay
$X = $Display.Bounds.Width
$Y = $Display.Bounds.Height
$AspectRatio = $X / $Y
$Fov = 90 # 16:10 by default
if ($AspectRatio -eq $(16 / 9)) {
$Fov = 97
}
$Config = @"
seta r_customwidth $X
seta r_customheight $Y
seta cg_fov 97
seta r_mode -1
seta s_kHz "44"
"@
Set-Content "$InstallDirectory\GameData\base\autoexec.cfg" $Config
Write-ReplaceContentInFile -Pattern '^seta name (.+)' -Substitution "seta name ""$NewPlayerAlias""" -FilePath "$InstallDirectory\GameData\base\jampconfig.cfg"