$NewName = $args[0]
$InstallDir = $PSScriptRoot
function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
$content = (Get-Content $FilePath) -replace $Regex, $Replacement
[IO.File]::WriteAllLines($FilePath, $content)
}
Write-ReplaceContentInFile -Regex '^set name (.+)' -Replacement "set name ""$NewName""" -FilePath "$InstallDir\baseq2\config.cfg"
$NewName = $args[0]
$InstallDir = $PSScriptRoot
Add-Type -AssemblyName System.Windows.Forms
$Display = [System.Windows.Forms.Screen]::AllScreens | Where-Object Primary | Select Bounds
function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
$content = (Get-Content $FilePath) -replace $Regex, $Replacement
[IO.File]::WriteAllLines($FilePath, $content)
}
$X = $Display.Width
$Y = $Display.Height
Write-ReplaceContentInFile -Regex 'set r_customheight = (.+)' -Replacement "set r_customheight = ""$Y""" -FilePath "$InstallDir\baseq2\config.cfg"
Write-ReplaceContentInFile -Regex 'set r_customwidth = (.+)' -Replacement "set r_customwidth = ""$X""" -FilePath "$InstallDir\baseq2\config.cfg"
Write-ReplaceContentInFile -Regex 'set vid_fullscreen = (.+)' -Replacement "set vid_fullscreen = ""1""" -FilePath "$InstallDir\baseq2\config.cfg"