Age of Empires III

From LANCommander
Revision as of 02:25, 23 February 2024 by DoctorDalek (talk | contribs) (Created new page for Age of Empires III)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
Ensemble Studios
Publishers
DestineerMacSoft GamesMicrosoft Game Studios
Release Date
Windows: October 18, 2005
Genres
SimulatorReal Time Strategy (RTS)Strategy
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play Age of Empires III {InstallDir}\age3.exe True
Play Age of Empires III: The Asian Dynasties {InstallDir}\age3y.exe True
Play Age of Empires III: The WarChiefs {InstallDir}\age3x.exe True

Install Script

$Documents = [Environment]::GetFolderPath('MyDocuments')
$Display = Get-PrimaryDisplay

$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE"

# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '<Setting Name="optiongrfxres">.*</Setting>' -Substitution "<Setting Name=""optiongrfxres"">$($Display.Bounds.Width) x $($Display.Bounds.Height)</Setting>" -FilePath "$Documents\My Games\Age of Empires 3\Users\New Profile.xml"
Write-ReplaceContentInFile -Pattern '<Setting Name="optiongrfxres">.*</Setting>' -Substitution "<Setting Name=""optiongrfxres"">$($Display.Bounds.Width) x $($Display.Bounds.Height)</Setting>" -FilePath "$Documents\My Games\Age of Empires 3\Users2\New Profile2.xml"
Write-ReplaceContentInFile -Pattern '<Setting Name="optiongrfxres">.*</Setting>' -Substitution "<Setting Name=""optiongrfxres"">$($Display.Bounds.Width) x $($Display.Bounds.Height)</Setting>" -FilePath "$Documents\My Games\Age of Empires 3\Users3\New Profile3.xml"

New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games"

New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3" -Force
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3\1.0" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3\1.0" -Name "FIRSTRUN" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3\1.0" -Name "SystemInitialization" -Value "1" -Force

New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack" -Force
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack\1.0" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack\1.0" -Name "FIRSTRUN" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack\1.0" -Name "SystemInitialization" -Value "1" -Force

New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack 2" -Force
New-Item -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack 2\1.0" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack 2\1.0" -Name "FIRSTRUN" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack 2\1.0" -Name "SystemInitialization" -Value "1" -Force

New-Item -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games"
New-Item -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3"
New-Item -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3\1.0"
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3\1.0" -Name "LangID" -Value 1033 -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3\1.0" -Name "Version" -Value "1.14" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3\1.0" -Name "SetupPath" -Value "$InstallDirectory" -Force

New-Item -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack"
New-Item -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack\1.0"
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack\1.0" -Name "LangID" -Value 1033 -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack\1.0" -Name "Version" -Value "1.06" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack\1.0" -Name "SetupPath" -Value "$InstallDirectory" -Force

New-Item -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack 2"
New-Item -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack 2\1.0"
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack 2\1.0" -Name "LangID" -Value 1033 -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack 2\1.0" -Name "Version" -Value "1.03" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Microsoft\Microsoft Games\Age of Empires 3 Expansion Pack 2\1.0" -Name "SetupPath" -Value "$InstallDirectory" -Force

Name Change Script

$Documents = [Environment]::GetFolderPath('MyDocuments')

if (Test-Path "$Documents\My Games\Age of Empires 3") {
    # Nothing
} else {
    Copy-Item -Path "$InstallDirectory\ProfileTemplate" -Destination "$Documents\My Games\Age of Empires 3" -Recurse

    $Guid = [Guid]::NewGuid().ToString().ToUpper()
    $Guid2 = [Guid]::NewGuid().ToString().ToUpper()
    $Guid3 = [Guid]::NewGuid().ToString().ToUpper()

    Write-ReplaceContentInFile -Pattern '<GUID>.*</GUID>' -Substitution "<GUID>{$Guid}</GUID>" -FilePath "$Documents\My Games\Age of Empires 3\Users\NewProfile.xml"
    Write-ReplaceContentInFile -Pattern '<GUID>.*</GUID>' -Substitution "<GUID>{$Guid2}</GUID>" -FilePath "$Documents\My Games\Age of Empires 3\Users2\NewProfile2.xml"
    Write-ReplaceContentInFile -Pattern '<GUID>.*</GUID>' -Substitution "<GUID>{$Guid3}</GUID>" -FilePath "$Documents\My Games\Age of Empires 3\Users3\NewProfile3.xml"
}

# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '<Setting Name="optionskirmishnickname">.*</Setting>' -Substitution "<Setting Name=""optionskirmishnickname"">$NewPlayerAlias</Setting>" -FilePath "$Documents\My Games\Age of Empires 3\Users\NewProfile.xml"
Write-ReplaceContentInFile -Pattern '<Setting Name="optionskirmishnickname">.*</Setting>' -Substitution "<Setting Name=""optionskirmishnickname"">$NewPlayerAlias</Setting>" -FilePath "$Documents\My Games\Age of Empires 3\Users2\NewProfile2.xml"
Write-ReplaceContentInFile -Pattern '<Setting Name="optionskirmishnickname">.*</Setting>' -Substitution "<Setting Name=""optionskirmishnickname"">$NewPlayerAlias</Setting>" -FilePath "$Documents\My Games\Age of Empires 3\Users3\NewProfile3.xml"