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"