Need for Speed: Hot Pursuit 2: Difference between revisions

From LANCommander
(Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|EA Seattle}} {{Game.InfoBox.Developer|Black Box Games}} |Publishers = {{Game.InfoBox.Publisher|Electronic Arts}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|September 30, 2002}} |Genres = {{Game.InfoBox.Genre|Racing}} | PCGamingWiki = Need_for_Speed:_Hot_Pursuit_2 }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = nfshp2.exe|Arguments = |WorkingDirecto...")
 
No edit summary
 
Line 3: Line 3:
|Cover = cover.jpg
|Cover = cover.jpg
|Developers =
|Developers =
{{Game.InfoBox.Developer|EA Seattle}}
{{Game.InfoBox.Developer|Black Box Games}}{{Game.InfoBox.Developer|EA Seattle}}
{{Game.InfoBox.Developer|Black Box Games}}
|Publishers =
|Publishers =
{{Game.InfoBox.Publisher|Electronic Arts}}
{{Game.InfoBox.Publisher|Electronic Arts}}
Line 11: Line 10:
|Genres =
|Genres =
{{Game.InfoBox.Genre|Racing}}
{{Game.InfoBox.Genre|Racing}}
| PCGamingWiki = Need_for_Speed:_Hot_Pursuit_2
|PCGamingWiki = Need_for_Speed:_Hot_Pursuit_2}}
}}


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


{{Game.Scripts.Install
{{Game.Scripts.Install
|Name = Install Script
|Name = Install Script
|Description =  
|Description =  
|RequiresAdmin = True
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$InstallDir = $PSScriptRoot
<syntaxhighlight lang="powershell" line>
# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay
 
$InstallDrive = Split-Path -Path $InstallDirectory -Qualifier


New-Item -ItemType Directory -Force -Path "$($env:USERPROFILE)\Documents\EA Games\Need For Speed Hot Pursuit 2"
New-Item -ItemType Directory -Path "$env:userprofile\Documents\EA Games\Need For Speed Hot Pursuit 2\" -force


Copy-Item "$InstallDir\ProfileTemplate" -Destination "$($env:USERPROFILE)\Documents\EA Games\Need For Speed Hot Pursuit 2" -Recurse
Copy-Item "$InstallDirectory\ProfileTempate\*.*" -Destination "$env:userprofile\Documents\EA Games\Need For Speed Hot Pursuit 2" -Recurse


New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0"


New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{76F4DD9B-C246-4BE0-00B6-3DE9ABF72299}"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{76F4DD9B-C246-4BE0-00B6-3DE9ABF72299}"


New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe"


Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "CacheSize" -Value 546357 -Force
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "CacheSize" -Value 546357 -Force


# These should match and it needs to be a drive that is actually mapped
# These should match and it needs to be a drive that is actually mapped
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "CD Drive" -Value "C:\" -Force
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "CD Drive" -Value "$InstallDrive\" -Force
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Installed From" -Value "C:\"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Installed From" -Value "$InstallDrive\"
 
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "DisplayName" -Value "Need For Speed Hot Pursuit 2"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Folder" -Value "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\EA Games\Need For Speed Hot Pursuit 2\"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Install Dir" -Value "$InstallDirectory"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Language" -Value "English US"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Patch URL" -Value "http://patches.ea.com/nfshp2/EN-US/home.html"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Product GUID" -Value "{76F4DD9B-C246-4BE0-00B6-3DE9ABF72299}"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Region" -Value "en-us"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "SwapSize" -Value 0
 
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "DisplayName" -Value "Need For Speed Hot Pursuit 2"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "Language" -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "LanguageName" -Value "English US"
 
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Game Registry" -Value "SOFTWARE\EA Games\Need For Speed Hot Pursuit 2"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Restart" -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Path" -Value "$InstallDirectory"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "(Default)" -Value "$InstallDirectory\NFSHP2.exe"
 
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Game Registry" -Value "SOFTWARE\EA Games\Need For Speed Hot Pursuit 2"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Restart" -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Path" -Value "$InstallDirectory"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "(Default)" -Value "$InstallDirectory\NFSHP2.exe"
 
Rename-Item -Path "$InstallDirectory\movies\hp2e.mad" -NewName "$InstallDirectory\movies\hp2e.mad.bak"
Rename-Item -Path "$InstallDirectory\movies\logoE.mad" -NewName "$InstallDirectory\movies\logoE.mad.bak"
Rename-Item -Path "$InstallDirectory\movies\LogoS.mad" -NewName "$InstallDirectory\movies\LogoS.mad.bak"


Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "DisplayName" -Value "Need For Speed Hot Pursuit 2"
New-Item -Path "$InstallDirectory\movies\" -Name "hp2e.mad" -ItemType "file" -Value " " -force
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Folder" -Value "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\EA Games\Need For Speed Hot Pursuit 2\"
New-Item -Path "$InstallDirectory\movies\" -Name "logoE.mad" -ItemType "file" -Value " " -force
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Install Dir" -Value "$InstallDir"
New-Item -Path "$InstallDirectory\movies\" -Name "LogoS.mad" -ItemType "file" -Value " " -force
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Language" -Value "English US"
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Patch URL" -Value "http://patches.ea.com/nfshp2/EN-US/home.html"
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Product GUID" -Value "{76F4DD9B-C246-4BE0-00B6-3DE9ABF72299}"
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Region" -Value "en-us"
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "SwapSize" -Value 0


Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "DisplayName" -Value "Need For Speed Hot Pursuit 2"
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "Language" -Value 1
Write-ReplaceContentInFile -Pattern '^Width=(.+)' -Substitution "Width=$($Display.Bounds.Width)" -FilePath "$env:userprofile\Documents\EA Games\Need For Speed Hot Pursuit 2\rendercaps.ini"
Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "LanguageName" -Value "English US"
Write-ReplaceContentInFile -Pattern '^Height=(.+)' -Substitution "Height=$($Display.Bounds.Height)" -FilePath "$env:userprofile\Documents\EA Games\Need For Speed Hot Pursuit 2\rendercaps.ini"


Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Game Registry" -Value "SOFTWARE\EA Games\Need For Speed Hot Pursuit 2"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Restart" -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Path" -Value "$InstallDir"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "(Default)" -Value "$InstallDir\NFSHP2.exe"


Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Game Registry" -Value "SOFTWARE\EA Games\Need For Speed Hot Pursuit 2"
#$Documents = [Environment]::GetFolderPath("MyDocuments")
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Restart" -Value 0
#$ProgramData = [Environment]::GetFolderPath("CommonApplicationData")
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Path" -Value "$InstallDir"
#$InstallDrive = Split-Path -Path $InstallDirectory -Qualifier
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "(Default)" -Value "$InstallDir\NFSHP2.exe"
#
#New-Item -ItemType Directory -Force -Path "$Documents\EA Games\Need For Speed Hot Pursuit 2"
#
#Copy-Item "$InstallDirectory\ProfileTemplate" -Destination "$Documents\EA Games\Need For Speed Hot Pursuit 2" -Recurse
#
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0"
#
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{76F4DD9B-C246-4BE0-00B6-3DE9ABF72299}"
#
#New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe"
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "CacheSize" -Value 546357 -Force
#
## These should match and it needs to be a drive that is actually mapped
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "CD Drive" -Value "$InstallDrive\" -Force
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Installed From" -Value "$InstallDrive\"
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "DisplayName" -Value "Need For Speed Hot Pursuit 2"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Folder" -Value "$ProgramData\Microsoft\Windows\Start Menu\Programs\EA Games\Need For Speed Hot Pursuit 2\"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Install Dir" -Value "$InstallDirectory"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Language" -Value "English US"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Patch URL" -Value "http://patches.ea.com/nfshp2/EN-US/home.html"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Product GUID" -Value "{76F4DD9B-C246-4BE0-00B6-3DE9ABF72299}"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Region" -Value "en-us"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "SwapSize" -Value 0
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "DisplayName" -Value "Need For Speed Hot Pursuit 2"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "Language" -Value 1
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "LanguageName" -Value "English US"
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Game Registry" -Value "SOFTWARE\EA Games\Need For Speed Hot Pursuit 2"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Restart" -Value 0
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Path" -Value "$InstallDirectory"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "(Default)" -Value "$InstallDirectory\NFSHP2.exe"
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Game Registry" -Value "SOFTWARE\EA Games\Need For Speed Hot Pursuit 2"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Restart" -Value 0
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Path" -Value "$InstallDirectory"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "(Default)" -Value "$InstallDirectory\NFSHP2.exe"
</syntaxhighlight>
</syntaxhighlight>
}}
}}
           
{{Game.Scripts.Uninstall
|Name = Uninstall Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
Remove-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2" -Recurse -ErrorAction Ignore
Remove-Item -path "$env:userprofile\Documents\EA Games\Need For Speed Hot Pursuit 2" -recurse -force


</syntaxhighlight>
}}
           
{{Game.Scripts.NameChange
|Name = Name Change Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
$Documents = [Environment]::GetFolderPath("MyDocuments")
Write-ReplaceContentInFile -Pattern '^playerName(.+)' -Substitution "playerName=$NewPlayerAlias" -FilePath "$Documents\EA Games\Need For Speed Hot Pursuit 2\netprefs.ini"
</syntaxhighlight>
}}
           
{{Game.Scripts.KeyChange
{{Game.Scripts.KeyChange
|Name = Key Change Script
|Name = Key Change Script
|Description =  
|Description =  
|RequiresAdmin = True
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts"
<syntaxhighlight lang="powershell" line>
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc"
 
$Key = $AllocatedKey -Replace "-", ""


$Key = $args[0] -Replace "-", ""
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc" -Name "(Default)" -Value $Key


Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc" -Name "(Default)" -Value $Key
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc"
#
#$Key = $AllocatedKey -Replace "-", ""
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc" -Name "(Default)" -Value $Key
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 03:29, 6 January 2024

Developers
Black Box GamesEA Seattle
Publishers
Electronic Arts
Release Date
Windows: September 30, 2002
Genres
Racing
View at PCGamingWiki

Actions

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

Install Script

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

$InstallDrive = Split-Path -Path $InstallDirectory -Qualifier

New-Item -ItemType Directory -Path "$env:userprofile\Documents\EA Games\Need For Speed Hot Pursuit 2\" -force

Copy-Item "$InstallDirectory\ProfileTempate\*.*" -Destination "$env:userprofile\Documents\EA Games\Need For Speed Hot Pursuit 2" -Recurse

New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0"

New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{76F4DD9B-C246-4BE0-00B6-3DE9ABF72299}"

New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe"

Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "CacheSize" -Value 546357 -Force

# These should match and it needs to be a drive that is actually mapped
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "CD Drive" -Value "$InstallDrive\" -Force
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Installed From" -Value "$InstallDrive\"

Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "DisplayName" -Value "Need For Speed Hot Pursuit 2"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Folder" -Value "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\EA Games\Need For Speed Hot Pursuit 2\"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Install Dir" -Value "$InstallDirectory"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Language" -Value "English US"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Patch URL" -Value "http://patches.ea.com/nfshp2/EN-US/home.html"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Product GUID" -Value "{76F4DD9B-C246-4BE0-00B6-3DE9ABF72299}"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Region" -Value "en-us"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "SwapSize" -Value 0

Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "DisplayName" -Value "Need For Speed Hot Pursuit 2"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "Language" -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "LanguageName" -Value "English US"

Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Game Registry" -Value "SOFTWARE\EA Games\Need For Speed Hot Pursuit 2"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Restart" -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Path" -Value "$InstallDirectory"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "(Default)" -Value "$InstallDirectory\NFSHP2.exe"

Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Game Registry" -Value "SOFTWARE\EA Games\Need For Speed Hot Pursuit 2"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Restart" -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Path" -Value "$InstallDirectory"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "(Default)" -Value "$InstallDirectory\NFSHP2.exe"

Rename-Item -Path "$InstallDirectory\movies\hp2e.mad" -NewName "$InstallDirectory\movies\hp2e.mad.bak"
Rename-Item -Path "$InstallDirectory\movies\logoE.mad" -NewName "$InstallDirectory\movies\logoE.mad.bak"
Rename-Item -Path "$InstallDirectory\movies\LogoS.mad" -NewName "$InstallDirectory\movies\LogoS.mad.bak"

New-Item -Path "$InstallDirectory\movies\" -Name "hp2e.mad" -ItemType "file" -Value " " -force
New-Item -Path "$InstallDirectory\movies\" -Name "logoE.mad" -ItemType "file" -Value " " -force
New-Item -Path "$InstallDirectory\movies\" -Name "LogoS.mad" -ItemType "file" -Value " " -force

# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^Width=(.+)' -Substitution "Width=$($Display.Bounds.Width)" -FilePath "$env:userprofile\Documents\EA Games\Need For Speed Hot Pursuit 2\rendercaps.ini"
Write-ReplaceContentInFile -Pattern '^Height=(.+)' -Substitution "Height=$($Display.Bounds.Height)" -FilePath "$env:userprofile\Documents\EA Games\Need For Speed Hot Pursuit 2\rendercaps.ini"


#$Documents = [Environment]::GetFolderPath("MyDocuments")
#$ProgramData = [Environment]::GetFolderPath("CommonApplicationData")
#$InstallDrive = Split-Path -Path $InstallDirectory -Qualifier
#
#New-Item -ItemType Directory -Force -Path "$Documents\EA Games\Need For Speed Hot Pursuit 2"
#
#Copy-Item "$InstallDirectory\ProfileTemplate" -Destination "$Documents\EA Games\Need For Speed Hot Pursuit 2" -Recurse
#
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0"
#
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{76F4DD9B-C246-4BE0-00B6-3DE9ABF72299}"
#
#New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe"
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "CacheSize" -Value 546357 -Force
#
## These should match and it needs to be a drive that is actually mapped
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "CD Drive" -Value "$InstallDrive\" -Force
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Installed From" -Value "$InstallDrive\"
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "DisplayName" -Value "Need For Speed Hot Pursuit 2"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Folder" -Value "$ProgramData\Microsoft\Windows\Start Menu\Programs\EA Games\Need For Speed Hot Pursuit 2\"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Install Dir" -Value "$InstallDirectory"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Language" -Value "English US"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Patch URL" -Value "http://patches.ea.com/nfshp2/EN-US/home.html"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Product GUID" -Value "{76F4DD9B-C246-4BE0-00B6-3DE9ABF72299}"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "Region" -Value "en-us"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2" -Name "SwapSize" -Value 0
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "DisplayName" -Value "Need For Speed Hot Pursuit 2"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "Language" -Value 1
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\EA Games\Need For Speed Hot Pursuit 2\1.0" -Name "LanguageName" -Value "English US"
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Game Registry" -Value "SOFTWARE\EA Games\Need For Speed Hot Pursuit 2"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Restart" -Value 0
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Path" -Value "$InstallDirectory"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "(Default)" -Value "$InstallDirectory\NFSHP2.exe"
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Game Registry" -Value "SOFTWARE\EA Games\Need For Speed Hot Pursuit 2"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Restart" -Value 0
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "Path" -Value "$InstallDirectory"
#Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows\CurrentVersion\App Paths\NFSHP2.exe" -Name "(Default)" -Value "$InstallDirectory\NFSHP2.exe"

Uninstall Script

Remove-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2" -Recurse -ErrorAction Ignore
Remove-Item -path "$env:userprofile\Documents\EA Games\Need For Speed Hot Pursuit 2" -recurse -force

Name Change Script

$Documents = [Environment]::GetFolderPath("MyDocuments")
Write-ReplaceContentInFile -Pattern '^playerName(.+)' -Substitution "playerName=$NewPlayerAlias" -FilePath "$Documents\EA Games\Need For Speed Hot Pursuit 2\netprefs.ini"

Key Change Script

New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2"
New-Item -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc"

$Key = $AllocatedKey -Replace "-", ""

Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc" -Name "(Default)" -Value $Key

#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2"
#New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc"
#
#$Key = $AllocatedKey -Replace "-", ""
#
#Set-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Need For Speed Hot Pursuit 2\ergc" -Name "(Default)" -Value $Key