Carmageddon II: Carpocalypse Now

From LANCommander
Revision as of 06:56, 31 July 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Release Date = {{Game.InfoBox.ReleaseDate|Windows|October 12, 1998}} | PCGamingWiki = Carmageddon_II:_Carpocalypse_Now }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = CARMA2_HW.EXE|Arguments = |WorkingDirectory = |Primary = True}} }} {{Game.Scripts.Install |Name = Install Script |Description = |RequiresAdmin = True |Contents = <syntaxhighlight lang="powershell" line> $InstallDir = $PSScriptR...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Release Date
Windows: October 12, 1998
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play CARMA2_HW.EXE True

Install Script

This script requires admin access to function properly

$InstallDir = $PSScriptRoot

New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"

New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" -Name "$InstallDir\CARMA2_HW.EXE" -Value "~ WINXPSP2 HIGHDPIAWARE" -Force

Name Change Script

$NewName = $args[0]
$InstallDir = $PSScriptRoot

if ($NewName.Length -gt 8) {
    $NewName = $NewName.Substring(0, 8)
}

function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}

Write-ReplaceContentInFile -Regex '^PlayerName 0\s+.+' -Replacement "PlayerName 0`r`n$NewName" -FilePath "$InstallDir\DATA\OPTIONS.TXT"