1414 $runtimeSourceRoot = Join-Path $temporaryRoot $runtimeSourceName
1515 $runtimeStateRoot = Join-Path $temporaryRoot ' runtime-state'
1616 New-Item - ItemType Directory - Path $runtimeSourceRoot | Out-Null
17- foreach ($directoryName in @ (' assets' , ' scripts' )) {
17+ foreach ($directoryName in @ (' assets' , ' scripts' , ' presets ' )) {
1818 Copy-Item - LiteralPath (Join-Path $Root $directoryName ) - Destination $runtimeSourceRoot `
1919 - Recurse - Force - ErrorAction Stop
2020 }
@@ -28,11 +28,11 @@ try {
2828 $engine = Install-DreamSkinRuntimeEngine - SkillRoot $runtimeSourceRoot - StateRoot $runtimeStateRoot
2929 $sourcePrefix = $runtimeSourceRoot.TrimEnd (' \' ) + ' \'
3030 $runtimeSourceFiles = @ (
31- Get-ChildItem - LiteralPath (Join-Path $runtimeSourceRoot ' assets' ), (Join-Path $runtimeSourceRoot ' scripts' ) `
31+ Get-ChildItem - LiteralPath (Join-Path $runtimeSourceRoot ' assets' ), (Join-Path $runtimeSourceRoot ' scripts' ), ( Join-Path $runtimeSourceRoot ' presets ' ) `
3232 - Recurse - File - Force
3333 )
3434 $runtimeEngineFiles = @ (
35- Get-ChildItem - LiteralPath (Join-Path $engine.Root ' assets' ), (Join-Path $engine.Root ' scripts' ) `
35+ Get-ChildItem - LiteralPath (Join-Path $engine.Root ' assets' ), (Join-Path $engine.Root ' scripts' ), ( Join-Path $engine .Root ' presets ' ) `
3636 - Recurse - File - Force
3737 )
3838 if ($runtimeSourceFiles.Count -ne $runtimeEngineFiles.Count -or
@@ -654,10 +654,15 @@ try {
654654 throw ' Default Windows theme did not seed the Arina Hashimoto wallpaper contract.'
655655 }
656656 $preseededThemes = @ (Get-DreamSkinSavedThemes - StateRoot $themeStateRoot )
657- if ($preseededThemes.Count -ne 1 -or
658- $preseededThemes [0 ].Id -cne ' preset-arina-hashimoto' -or
659- $preseededThemes [0 ].Name -cne ' 桥本有菜' ) {
660- throw ' Arina Hashimoto was not preseeded in the Windows saved-theme menu.'
657+ $preseededIds = @ ($preseededThemes | ForEach-Object { $_.Id })
658+ if ($preseededThemes.Count -lt 2 -or
659+ $preseededIds -notcontains ' preset-arina-hashimoto' -or
660+ $preseededIds -notcontains ' preset-gothic-void-crusade' ) {
661+ throw ' Windows did not preseed both Arina Hashimoto and Gothic Void Crusade.'
662+ }
663+ $gothicSeed = $preseededThemes | Where-Object { $_.Id -ceq ' preset-gothic-void-crusade' } | Select-Object - First 1
664+ if ($null -eq $gothicSeed -or $gothicSeed.Name -cne ' Gothic Void Crusade' ) {
665+ throw ' Gothic Void Crusade was not preseeded with the expected display name.'
661666 }
662667 $updatedTheme = Set-DreamSkinActiveTheme - ImagePath (Join-Path $Root ' assets\dream-reference.jpg' ) `
663668 - Theme $null - Name ' 测试主题' - StateRoot $themeStateRoot
@@ -670,12 +675,12 @@ try {
670675 }
671676 $null = Initialize-DreamSkinThemeStore - SkillRoot $Root - StateRoot $themeStateRoot
672677 $idempotentTheme = Read-DreamSkinTheme - ThemeDirectory $themePaths.Active
673- if ( $idempotentTheme .Theme.id -cne ' custom ' -or
674- @ ( Get-DreamSkinSavedThemes - StateRoot $themeStateRoot ).Count -ne 1 ) {
675- throw ' Theme-store initialization overwrote the active custom theme or duplicated its bundled preset .'
678+ $afterReinitCount = @ ( Get-DreamSkinSavedThemes - StateRoot $themeStateRoot ).Count
679+ if ( $idempotentTheme .Theme.id -cne ' custom ' -or $afterReinitCount -ne 2 ) {
680+ throw ' Theme-store initialization overwrote the active custom theme or duplicated its bundled presets .'
676681 }
677682 $savedTheme = Save-DreamSkinCurrentTheme - Name ' 已保存主题' - StateRoot $themeStateRoot
678- if ($savedTheme.Theme.name -cne ' 已保存主题' -or @ (Get-DreamSkinSavedThemes - StateRoot $themeStateRoot ).Count -ne 2 ) {
683+ if ($savedTheme.Theme.name -cne ' 已保存主题' -or @ (Get-DreamSkinSavedThemes - StateRoot $themeStateRoot ).Count -ne 3 ) {
679684 throw ' Saved theme creation or discovery failed.'
680685 }
681686 $null = Use-DreamSkinSavedTheme - ThemeDirectory $savedTheme.Directory - StateRoot $themeStateRoot
0 commit comments