Postal 2

From LANCommander
Revision as of 01:21, 1 August 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Running with Scissors}} |Publishers = {{Game.InfoBox.Publisher|Whiptail Interactive}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|April 13, 2003}} |Genres = {{Game.InfoBox.Genre|Adventure}} {{Game.InfoBox.Genre|Indie}} {{Game.InfoBox.Genre|Shooter}} | PCGamingWiki = Postal_2 }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play (Singleplayer)|Path = System/Posta...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
Running with Scissors
Publishers
Whiptail Interactive
Release Date
Windows: April 13, 2003
Genres
Adventure

Indie Shooter

View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play (Singleplayer) System/Postal2.exe True
Play (Multiplayer) ShareThePain/System/Postal2MP.exe True

Name Change Script

$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 'Name=(.+)' -Replacement "Name=$NewName" -FilePath "$InstallDir\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Regex 'Name=(.+)' -Replacement "Name=$NewName" -FilePath "$InstallDir\ShareThePain\System\User.ini"

Install Script

$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 'StartupFullscreen=(.+)' -Replacement "StartupFullscreen=True" -FilePath "$InstallDir\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Regex 'WindowedViewportX=(.+)' -Replacement "WindowedViewportX=$X" -FilePath "$InstallDir\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Regex 'WindowedViewportY=(.+)' -Replacement "WindowedViewportY=$Y" -FilePath "$InstallDir\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Regex 'FullscreenViewportX=(.+)' -Replacement "FullscreenViewportX=$X" -FilePath "$InstallDir\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Regex 'FullscreenViewportY=(.+)' -Replacement "FullscreenViewportY=$Y" -FilePath "$InstallDir\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Regex 'MenuViewportX=(.+)' -Replacement "MenuViewportX=$X" -FilePath "$InstallDir\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Regex 'MenuViewportY=(.+)' -Replacement "MenuViewportY=$Y" -FilePath "$InstallDir\ShareThePain\System\Default.ini"