Marathon 2: Durandal: Difference between revisions

From LANCommander
(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...")
 
No edit summary
 
Line 3: Line 3:
|Cover = cover.jpg
|Cover = cover.jpg
|Developers =
|Developers =
{{Game.InfoBox.Developer|Freeverse Software}}
{{Game.InfoBox.Developer|Freeverse Software}}{{Game.InfoBox.Developer|Bungie}}
{{Game.InfoBox.Developer|Bungie}}
|Publishers =
|Publishers =
{{Game.InfoBox.Publisher|Bungie}}
{{Game.InfoBox.Publisher|Bungie}}{{Game.InfoBox.Publisher|Microsoft Game Studios}}
{{Game.InfoBox.Publisher|Microsoft Game Studios}}
|Release Date =
|Release Date =
{{Game.InfoBox.ReleaseDate|Windows|November 24, 1995}}
{{Game.InfoBox.ReleaseDate|Windows|November 24, 1995}}
|Genres =
|Genres =
{{Game.InfoBox.Genre|Shooter}}
{{Game.InfoBox.Genre|Shooter}}
| PCGamingWiki = Marathon_2:_Durandal
|PCGamingWiki = Marathon_2:_Durandal}}
}}


{{Game.ActionBox
{{Game.ActionBox
|Actions =  
|Actions =  
{{Game.ActionBox.Row|Name = Play|Path = Marathon 2.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\Marathon 2.exe|Arguments = |WorkingDirectory = |Primary = True}}
}}
}}


{{Game.Scripts.NameChange
 
|Name = Name Change Script
{{Game.Scripts.Install
|Name = Install Script
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$NewName = $args[0]
<syntaxhighlight lang="powershell" line>
$InstallDir = $PSScriptRoot
New-Item -ItemType Directory -Force -Path "$($env:LOCALAPPDATA)\AlephOne"
 
Copy-Item -Path "$InstallDirectory\Preferences" -Destination "$($env:LOCALAPPDATA)\AlephOne\Marathon 2 Preferences"
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
</syntaxhighlight>
</syntaxhighlight>
}}
}}
 
           
{{Game.Scripts.Install
{{Game.Scripts.NameChange
|Name = Install Script
|Name = Name Change Script
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$InstallDir = $PSScriptRoot
<syntaxhighlight lang="powershell" line>
$Path = "$($env:LOCALAPPDATA)\AlephOne\Marathon 2 Preferences"


New-Item -ItemType Directory -Force -Path "$($env:LOCALAPPDATA)\AlephOne"
Write-ReplaceContentInFile -Pattern "player name=""[^""]+""" -Substitution "player name=`"$NewPlayerAlias`"" -FilePath $Path
Copy-Item -Path "$InstallDir\Preferences" -Destination "$($env:LOCALAPPDATA)\AlephOne\Marathon 2 Preferences"
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 03:29, 6 January 2024

Developers
Freeverse SoftwareBungie
Publishers
BungieMicrosoft Game Studios
Release Date
Windows: November 24, 1995
Genres
Shooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play {InstallDir}\Marathon 2.exe True

Install Script

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

Name Change Script

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

Write-ReplaceContentInFile -Pattern "player name=""[^""]+""" -Substitution "player name=`"$NewPlayerAlias`"" -FilePath $Path