Actions
Name |
Path |
Arguments |
Working Directory |
Primary |
Play |
{InstallDir}\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.
$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
# 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 -Regex '^INGAME_RES=(.+)' -Replacement "INGAME_RES=$($Display.Bounds.Width)x$($Display.Bounds.Height)x32" -FilePath "$InstallDirectory\keeperfx.cfg"
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "GUID Index" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "GUID Index Verified Working" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "GUID Index Is Default" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Gamma Level" -Value 4096 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Ambient Light" -Value 512 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "HighWalls" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Torture Details" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Res 1600*1200 Enable" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Res 1280*1024 Enable" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Res 1024*768 Enabled" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Engine Id" -Value 2 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Cheap Lighting" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Sine Wave Water" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "View Distance" -Value 12 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Shadow Level" -Value 3 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "EnvironmentMapping" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Translucent Water" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "PMesh Reduction Level" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Texture Reduction Level" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Solid Blueprints" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Should Draw Opt Background Alpha" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Screen Width" -Value $Display.Bounds.Width -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Screen Height" -Value $Display.Bounds.Height -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Screen Depth" -Value 32 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Screen Windowed" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Screen Swap" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Screen Hardware3D" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Machine Spec Level" -Value 10 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "High Res Textures" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "D3D Device Guid" -Value "{84E63DE0-46AA-11CF-816F-0000C020156E}" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "Version Number" -Value 4 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "StippleAlpha" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\Software\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Video" -Name "BumpMappingConfig" -Value 1 -Force
Uninstall Script
$BasePath = "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II"
Remove-Item -Path "$BasePath" -Force -Recurse
Name Change Script
# Trim a string down to a specified amount of characters
if ($NewPlayerAlias.Length -gt 10) {
$NewPlayerAlias = $NewPlayerAlias.Substring(0, 10);
}
New-ItemProperty -Path "HKCU:\SOFTWARE\Bullfrog Productions Ltd\Dungeon Keeper II\Configuration\Player" -Name "Multiplayer Name" -Value "$NewPlayerAlias" -Force