Dune 2000

From LANCommander
Revision as of 00:42, 22 February 2024 by DoctorDalek (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
Westwood Studios
Publishers
Westwood StudiosElectronic Arts
Release Date
Windows: September 1, 1998
Genres
Real Time Strategy (RTS)Strategy
View at PCGamingWiki

Actions

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

Install Script

$filePath = "$InstallDirectory\dune2000.ini"

# Get the screen resolution
Add-Type -AssemblyName System.Windows.Forms
$screen = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Size
$width = $screen.Width
$height= $screen.Height

# Read the content of the file
$content = Get-Content -Path $filePath

# Loop through each line in the file
for ($i = 0; $i -lt $content.Count; $i++) {
    $line = $content[$i]

    # Check if the line contains "SCREENWIDTH" and "640"
    if ($line -like '*GameWidth*') {
        # Replace the line with the updated width
        $content[$i] = "GameWidth=$width"
    }
        if ($line -like '*GameHeight*') {
        # Replace the line with the updated width
        $content[$i] = "GameHeight=$height"
    }
}

# Save the updated content back to the file
$content | Set-Content -Path $filePath

Name Change Script

Write-ReplaceContentInFile -Pattern 'Nickname=(.+)' -Substitution "Nickname=$NewPlayerAlias" -FilePath "$InstallDirectory\cncnet5.ini"