Marathon 2: Durandal

From LANCommander
Revision as of 01:16, 1 August 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Freeverse Software}} {{Game.InfoBox.Developer|Bungie}} |Publishers = {{Game.InfoBox.Publisher|Bungie}} {{Game.InfoBox.Publisher|Microsoft Game Studios}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|November 24, 1995}} |Genres = {{Game.InfoBox.Genre|Shooter}} | PCGamingWiki = Marathon_2:_Durandal }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = Maratho...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
Freeverse Software

Bungie

Publishers
Bungie Microsoft Game Studios
Release Date
Windows: November 24, 1995
Genres
Shooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play Marathon 2.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 2 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 2 Preferences"