Carmageddon II: Carpocalypse Now: Difference between revisions

From LANCommander
(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...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
{{Game.InfoBox
{{Game.InfoBox
|Cover = cover.jpg
|Cover = cover.jpg
|Developers =
{{Game.InfoBox.Developer|Stainless Games Ltd.}}
|Publishers =
{{Game.InfoBox.Publisher|Sales Curve Interactive}}{{Game.InfoBox.Publisher|Interplay Entertainment}}
|Release Date =
|Release Date =
{{Game.InfoBox.ReleaseDate|Windows|October 12, 1998}}
{{Game.InfoBox.ReleaseDate|Windows|October 12, 1998}}
| PCGamingWiki = Carmageddon_II:_Carpocalypse_Now
|Genres =
}}
{{Game.InfoBox.Genre|Indie}}{{Game.InfoBox.Genre|Racing}}
|PCGamingWiki = Carmageddon_II:_Carpocalypse_Now}}


{{Game.ActionBox
{{Game.ActionBox
|Actions =  
|Actions =  
{{Game.ActionBox.Row|Name = Play|Path = CARMA2_HW.EXE|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\CARMA2_HW.EXE|Arguments = |WorkingDirectory = |Primary = True}}
}}
}}


{{Game.Scripts.Install
{{Game.Scripts.Install
|Name = Install Script
|Name = Install Script
|Description =  
|Description =  
|RequiresAdmin = True
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$InstallDir = $PSScriptRoot
<syntaxhighlight lang="powershell" line>
 
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
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
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" -Name "$InstallDirectory\CARMA2_HW.EXE" -Value "~ WINXPSP2 HIGHDPIAWARE" -Force
</syntaxhighlight>
</syntaxhighlight>
}}
}}
 
           
{{Game.Scripts.NameChange
{{Game.Scripts.NameChange
|Name = Name Change Script
|Name = Name Change Script
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$NewName = $args[0]
<syntaxhighlight lang="powershell" line>
$InstallDir = $PSScriptRoot
if ($NewPlayerAlias.Length -gt 8) {
 
     $NewPlayerAlias = $NewPlayerAlias.Substring(0, 8)
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"
Write-ReplaceContentInFile -Pattern '^PlayerName 0\s+.+' -Substitution "PlayerName 0`r`n$NewPlayerAlias" -FilePath "$InstallDirectory\DATA\OPTIONS.TXT"
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 00:39, 22 February 2024

Developers
Stainless Games Ltd.
Publishers
Sales Curve InteractiveInterplay Entertainment
Release Date
Windows: October 12, 1998
Genres
IndieRacing
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play {InstallDir}\CARMA2_HW.EXE True

Install Script

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

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

Name Change Script

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

Write-ReplaceContentInFile -Pattern '^PlayerName 0\s+.+' -Substitution "PlayerName 0`r`n$NewPlayerAlias" -FilePath "$InstallDirectory\DATA\OPTIONS.TXT"