Marathon Infinity: Difference between revisions

From LANCommander
(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|October 15, 1996}} |Genres = {{Game.InfoBox.Genre|Shooter}} | PCGamingWiki = Marathon_Infinity }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = Marathon Infinity.exe|Arguments = |WorkingDirectory = |Primary = True}} }} {{Game.Scripts.NameChange |Name...")
 
No edit summary
 
Line 10: Line 10:
|Genres =
|Genres =
{{Game.InfoBox.Genre|Shooter}}
{{Game.InfoBox.Genre|Shooter}}
| PCGamingWiki = Marathon_Infinity
|PCGamingWiki = Marathon_Infinity}}
}}


{{Game.ActionBox
{{Game.ActionBox
|Actions =  
|Actions =  
{{Game.ActionBox.Row|Name = Play|Path = Marathon Infinity.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\Marathon Infinity.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
$AppData = $env:LOCALAPPDATA


function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
New-Item -ItemType Directory -Force -Path "$AppData\AlephOne"
{
Copy-Item -Path "$InstallDirectory\Preferences" -Destination "$AppData\AlephOne\Marathon Infinity Preferences"
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}
 
$Path = "$($env:LOCALAPPDATA)\AlephOne\Marathon Infinity 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>
$AppData = $env:LOCALAPPDATA


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

Latest revision as of 03:29, 6 January 2024

Developers
Bungie
Publishers
Bungie
Release Date
Windows: October 15, 1996
Genres
Shooter
View at PCGamingWiki

Actions

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

Install Script

$AppData = $env:LOCALAPPDATA

New-Item -ItemType Directory -Force -Path "$AppData\AlephOne"
Copy-Item -Path "$InstallDirectory\Preferences" -Destination "$AppData\AlephOne\Marathon Infinity Preferences"

Name Change Script

$AppData = $env:LOCALAPPDATA

Write-ReplaceContentInFile -Pattern "player name=""[^""]+""" -Substitution "player name=`"$NewPlayerAlias`"" -FilePath "$AppData\AlephOne\Marathon Infinity Preferences"