Dungeons & Dragons: Dragonshard: Difference between revisions
DoctorDalek (talk | contribs) (Created new page for Dungeons & Dragons: Dragonshard) |
DoctorDalek (talk | contribs) No edit summary |
||
Line 5: | Line 5: | ||
{{Game.InfoBox.Developer|Liquid Entertainment}} | {{Game.InfoBox.Developer|Liquid Entertainment}} | ||
|Publishers = | |Publishers = | ||
{{Game.InfoBox. | {{Game.InfoBox.Publisher|Atari, Inc.}} | ||
|Release Date = | |Release Date = | ||
{{Game.InfoBox.ReleaseDate|Windows|September 21, 2005}} | {{Game.InfoBox.ReleaseDate|Windows|September 21, 2005}} | ||
Line 14: | Line 14: | ||
{{Game.ActionBox | {{Game.ActionBox | ||
|Actions = | |Actions = | ||
{{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\Dragonshard.exe|Arguments = |WorkingDirectory = |Primary = True}} | {{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\Dragonshard.exe|Arguments = -nointro|WorkingDirectory = |Primary = True}} | ||
}} | }} | ||
Line 21: | Line 21: | ||
|Name = Install Script | |Name = Install Script | ||
|Description = | |Description = | ||
|RequiresAdmin = | |RequiresAdmin = False | ||
|Contents = | |Contents = | ||
<syntaxhighlight lang="powershell" line> | <syntaxhighlight lang="powershell" line> | ||
Line 33: | Line 33: | ||
Write-ReplaceContentInFile -Pattern '^Height(.+)' -Substitution "Height = $($Display.Bounds.Height)" -FilePath "$InstallDirectory\DND.ini" | Write-ReplaceContentInFile -Pattern '^Height(.+)' -Substitution "Height = $($Display.Bounds.Height)" -FilePath "$InstallDirectory\DND.ini" | ||
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE" | |||
New-Item -Path "$VirtualStore\WOW6432Node\Liquid Entertainment" | |||
New-Item -Path "$VirtualStore\WOW6432Node\Liquid Entertainment\Dragonshard" | |||
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Liquid Entertainment\Dragonshard" -Name "Program" -Value "Dragonshard.exe" -Force | |||
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Liquid Entertainment\Dragonshard" -Name "Install Path" -Value "$InstallDirectory" -Force | |||
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Liquid Entertainment\Dragonshard" -Name "CD Key" -Value "JDZJ-QD6B-437T-WBDY" -Force | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
Line 116: | Line 46: | ||
|Name = Uninstall Script | |Name = Uninstall Script | ||
|Description = | |Description = | ||
|RequiresAdmin = | |RequiresAdmin = False | ||
|Contents = | |Contents = | ||
<syntaxhighlight lang="powershell" line> | <syntaxhighlight lang="powershell" line> | ||
$Documents = [Environment]::GetFolderPath("MyDocuments") | $Documents = [Environment]::GetFolderPath("MyDocuments") | ||
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE" | |||
Remove-Item -Path "$Documents\My Games\Dragonshard" -Force -Recurse | Remove-Item -Path "$Documents\My Games\Dragonshard" -Force -Recurse | ||
Remove-Item -Path " | Remove-Item -Path "$VirtualStore\WOW6432Node\Liquid Entertainment" -Force -Recurse | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
Line 168: | Line 99: | ||
[IO.File]::WriteAllBytes("$Documents\My Games\Dragonshard\Profiles\profiles.dat", $NameBytes) | [IO.File]::WriteAllBytes("$Documents\My Games\Dragonshard\Profiles\profiles.dat", $NameBytes) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} |
Latest revision as of 00:42, 22 February 2024
Developers | |
---|---|
Liquid Entertainment | |
Publishers | |
Atari, Inc. | |
Release Date | |
Windows: September 21, 2005 | |
Genres | |
StrategyRole-playing (RPG) | |
View at PCGamingWiki |
Actions
Name | Path | Arguments | Working Directory | Primary |
---|---|---|---|---|
Play | {InstallDir}\Dragonshard.exe | -nointro | True |
Install Script
# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay
Write-ReplaceContentInFile -Pattern '^video_resolutionX "(.+)"' -Substitution "video_resolutionX ""$($Display.Bounds.Width)""" -FilePath "$InstallDirectory\Dragonshard\Profiles\test.pro"
Write-ReplaceContentInFile -Pattern '^video_resolutionY "(.+)"' -Substitution "video_resolutionY ""$($Display.Bounds.Height)""" -FilePath "$InstallDirectory\Dragonshard\Profiles\test.pro"
Write-ReplaceContentInFile -Pattern '^Width(.+)' -Substitution "Width = $($Display.Bounds.Width)" -FilePath "$InstallDirectory\DND.ini"
Write-ReplaceContentInFile -Pattern '^Height(.+)' -Substitution "Height = $($Display.Bounds.Height)" -FilePath "$InstallDirectory\DND.ini"
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE"
New-Item -Path "$VirtualStore\WOW6432Node\Liquid Entertainment"
New-Item -Path "$VirtualStore\WOW6432Node\Liquid Entertainment\Dragonshard"
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Liquid Entertainment\Dragonshard" -Name "Program" -Value "Dragonshard.exe" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Liquid Entertainment\Dragonshard" -Name "Install Path" -Value "$InstallDirectory" -Force
New-ItemProperty -Path "$VirtualStore\WOW6432Node\Liquid Entertainment\Dragonshard" -Name "CD Key" -Value "JDZJ-QD6B-437T-WBDY" -Force
Uninstall Script
$Documents = [Environment]::GetFolderPath("MyDocuments")
$VirtualStore = "registry::\HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE"
Remove-Item -Path "$Documents\My Games\Dragonshard" -Force -Recurse
Remove-Item -Path "$VirtualStore\WOW6432Node\Liquid Entertainment" -Force -Recurse
Name Change Script
$Documents = [Environment]::GetFolderPath("MyDocuments")
$NewPlayerAlias = $NewPlayerAlias.Split([IO.Path]::GetInvalidFileNameChars()) -join '_'
$OldPlayerAlias = $NewPlayerAlias.Split([IO.Path]::GetInvalidFileNameChars()) -join '_'
$Display = Get-PrimaryDisplay
$Guid = [Guid]::NewGuid()
# Trim a string down to a specified amount of characters
if ($NewPlayerAlias.Length -gt 20) {
$NewPlayerAlias = $NewPlayerAlias.Substring(0, 20);
}
if ($OldPlayerAlias.Length -gt 20) {
$OldPlayerAlias = $OldPlayerAlias.Substring(0, 20);
}
if (Test-Path "$Documents\My Games\Dragonshard\Profiles\$OldPlayerAlias.pro") {
Move-Item "$Documents\My Games\Dragonshard\Profiles\$OldPlayerAlias.pro" "$Documents\My Games\Dragonshard\Profiles\$NewPlayerAlias.pro"
} else {
New-Item -ItemType Directory -Path "$Documents\My Games"
New-Item -ItemType Directory -Path "$Documents\My Games\Dragonshard"
New-Item -ItemType Directory -Path "$Documents\My Games\Dragonshard\Profiles"
Copy-Item -Path "$InstallDirectory\Dragonshard\Profiles\test.pro" -Destination "$Documents\My Games\Dragonshard\Profiles\$NewPlayerAlias.pro"
}
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^player_name "(.+)"' -Substitution "player_name ""$NewPlayerAlias""" -FilePath "$Documents\My Games\Dragonshard\Profiles\$NewPlayerAlias.pro"
Write-ReplaceContentInFile -Pattern '^player_filename "(.+)"' -Substitution "player_filename ""$NewPlayerAlias""" -FilePath "$Documents\My Games\Dragonshard\Profiles\$NewPlayerAlias.pro"
Write-ReplaceContentInFile -Pattern '^guid "(.+)"' -Substitution "guid ""{$($Guid.ToString())}""" -FilePath "$Documents\My Games\Dragonshard\Profiles\$NewPlayerAlias.pro"
# The profiles.dat file selects the last used profile. It's a binary file that starts with a 5 byte header with offset 0x01 describing the length of the name based on character count.
# The profile name itself is UTF16 encoded and is suffixed by two bytes of 0x00, probably to denote end-of-file.
$Header = @([byte] 0x00, 0x15, 0x00, 0x00, 0x00)
$NameBytes = ConvertTo-StringBytes -Input "$NewPlayerAlias" -Utf16 1 -MaxLength 21 -MinLength 21
$NameBytes = $Header + $NameBytes
[IO.File]::WriteAllBytes("$Documents\My Games\Dragonshard\Profiles\profiles.dat", $NameBytes)