Actions
Name |
Path |
Arguments |
Working Directory |
Primary |
Play |
DKII-DX.exe |
|
|
True |
Install Script
Create some basic registry keys. Multiplayer name one is important so we can override it with the name change script.
$InstallDir = $PSScriptRoot
$BasePath = "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II"
$ConfigurationPath = "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration"
$GamePath = "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Game"
$NetworkPath = "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Network"
$PathsPath = "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Paths"
$PlayerPath = "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Player"
$SoundPath = "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Sound"
$VideoPath = "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video"
Ner-Item -Path "HKCU:\SOFTWARE\Bullfrog Productions Ltd"
New-Item -Path "$BasePath"
New-Item -Path "$ConfigurationPath"
New-Item -Path "$GamePath"
New-Item -Path "$NetworkPath"
New-Item -Path "$PathsPath"
New-Item -Path "$PlayerPath"
New-Item -Path "$SoundPath"
New-Item -Path "$VideoPath"
New-ItemProperty -Path "$BasePath" -Name "Language" -Value 9 -Force
New-ItemProperty -Path "$ConfigurationPath" -Name "Version Number" -Value 11 -Force
New-ItemProperty -Path "$GamePath" -Name "GameSpeed" -Value 4 -Force
New-ItemProperty -Path "$GamePath" -Name "NewCampaign" -Value 1 -Force
New-ItemProperty -Path "$GamePath" -Name "ShowIntro" -Value 1 -Force
New-ItemProperty -Path "$GamePath" -Name "Version Number" -Value 0 -Force
New-ItemProperty -Path "$NetworkPath" -Name "Server Name" -Value "daphne.eagames.co.uk" -Force
New-ItemProperty -Path "$NetworkPath" -Name "Version Number" -Value 0 -Force
New-ItemProperty -Path "$PathsPath" -Name "Version Number" -Value 0 -Force
New-ItemProperty -Path "$PlayerPath" -Name "Multiplayer Name" -Value "Vintage" -Force
Name Change Script
$InstallDir = $PSScriptRoot
$NewName = $args[0]
# Trim a string down to a specified amount of characters
if ($NewName.Length -gt 10) {
$NewName = $NewName.Substring(0, 10);
}
New-ItemProperty -Path "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Player" -Name "Multiplayer Name" -Value "$NewName" -Force
Uninstall Script
$InstallDir = $PSScriptRoot
$BasePath = "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II"
Remove-Item -Path "$BasePath" -Force -Recurse