Freelancer

From LANCommander
Developers
Digital Anvil
Publishers
Microsoft Game Studios
Release Date
Windows: March 4, 2003
Genres
SimulatorAdventureShooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play Freelancer {InstallDir}\EXE\Freelancer.exe True

Install Script

$Documents = [Environment]::GetFolderPath("MyDocuments")
Copy-Item -Path "$InstallDirectory\Freelancer" -Destination "$Documents\My Games\Freelancer" -Recurse

# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay

# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^size= (.+)' -Substitution "size= $($Display.Bounds.Width), $($Display.Bounds.Height)" -FilePath "$Documents\My Games\Freelancer\PerfOptions.ini"
Write-ReplaceContentInFile -Pattern '^size = (.+)' -Substitution "size = $($Display.Bounds.Width),$($Display.Bounds.Height)" -FilePath "$InstallDirectory\exe\freelancer.ini"

Uninstall Script

$Documents = [Environment]::GetFolderPath("MyDocuments")
Remove-Item -Path "$Documents\My Games\Freelancer" -Recurse -force