Marathon

From LANCommander
Revision as of 01:15, 1 August 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Bungie}} |Publishers = {{Game.InfoBox.Publisher|Bungie}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|December 21, 1994}} |Genres = {{Game.InfoBox.Genre|Shooter}} | PCGamingWiki = Marathon }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = Marathon.exe|Arguments = |WorkingDirectory = |Primary = True}} }} {{Game.Scripts.NameChange |Name = Name Change Sc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
Bungie
Publishers
Bungie
Release Date
Windows: December 21, 1994
Genres
Shooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play Marathon.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)
}

$Path = "$($env:LOCALAPPDATA)\AlephOne\Marathon Preferences"

Write-ReplaceContentInFile -Regex "player name=""[^""]+""" -Replacement "player name=`"$NewName`"" -FilePath $Path

Install Script

$InstallDir = $PSScriptRoot

New-Item -ItemType Directory -Force -Path "$($env:LOCALAPPDATA)\AlephOne"
Copy-Item -Path "$InstallDir\Preferences" -Destination "$($env:LOCALAPPDATA)\AlephOne\Marathon Preferences"