Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Setup aborts at Phase 5/11 (Full) because SearchHighlightOff cannot write the protected SearchSettings key on Windows build 28000

未關閉 適合新手
#124 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
91/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
powershell

研究方向

從 steps/registry-taskbar-search.ps1 開始,將 SearchHighlightOff 與相鄰的 WidgetServiceOff 步驟進行比較,後者已經處理受保護的 Windows 設定。在 Windows 11 build 28000 上執行 Full setup 動作,或者如果儲存庫提供了相應測試,則新增一個有針對性的回歸測試。當這個受保護的登錄值不再中止 setup 且後續階段繼續執行時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

Summary

On Windows 11 build 28000, the Full action aborts at Phase 5/11 because the SearchHighlightOff tweak cannot write HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\SearchSettings\IsDynamicSearchBoxEnabled. Windows blocks value writes to that key at the kernel level, even for an elevated administrator.

Because the SearchHighlightOff step is not marked BestEffort (unlike the adjacent WidgetServiceOff step), this single un-writable cosmetic setting terminates the entire run, so Phases 6–11 (Edge, fonts, Terminal, PowerShell profile, Copilot, WSL) never execute.

Environment

Item Value
Windows Windows 11, build 28000 (Microsoft Windows NT 10.0.28000.0)
PowerShell 7.6.6 (Core)
winget v1.29.380
Setup entry point irm https://aka.ms/devconfig/full/setup.ps1 | iex
Resolved commit 06200f0819136c528e09533e3c8afac7e5f46ed7 (branch main)
Action Full
Elevation Yes — verified IsInRole(Administrator) = True for the running process

Steps to reproduce

  1. On Windows 11 build 28000, run irm https://aka.ms/devconfig/full/setup.ps1 | iex from an elevated PowerShell 7 session.
  2. Let setup complete Phases 1–4 and the first four steps of Phase 5.

Actual result

Phase 5/11 -- Taskbar, search & start tweaks
  ...
  -> Disable Show search highlights...

Calm OS setup stopped early.
  Windows blocked changing HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\SearchSettings\IsDynamicSearchBoxEnabled. Administrator access or Windows policy may restrict this setting.
  (_registry.ps1 line 50)
  Nothing already applied was undone -- running this again picks up where it left off.

The underlying exception is an UnauthorizedAccessException ("Attempted to perform an unauthorized operation./ 未经授权操作") raised by New-ItemProperty at steps/_registry.ps1:48, caught and rethrown with the friendly message at steps/_registry.ps1:50-52.

Re-running simply reproduces the identical failure, so Full can never advance past Phase 5 on this build.

Root cause

Windows on this build protects the SearchSettings key against value writes, independent of ACLs. The key is owned by the user and its ACL grants the user, SYSTEM and Administrators KEY_ALL_ACCESS (KA), with no Deny ACE — yet every value write is refused.

Note the key carries an explicit ACE for a MicrosoftWindows.Client.CBS AppContainer SID (S-1-15-3-1024-1086922356-207614091-3724853071-841836187-4018695103-34218837-3164163255-155871754), which is the search/taskbar package (SearchHost.exe runs from MicrosoftWindows.Client.CBS_cw5n1h2txyewy).

Methods attempted, all failing
Method Result
New-ItemProperty (PowerShell, elevated) Access is denied
reg.exe add HKCU\...\SearchSettings /v IsDynamicSearchBoxEnabled /t REG_DWORD /d 0 /f ERROR: Access is denied.
[Microsoft.Win32.RegistryKey]::SetValue() via OpenSubKey($true) Attempted to perform an unauthorized operation.
Rewrote the key ACL (removed the AppContainer ACE, granted the current user explicit FullControl) ACL change succeeded, write still failed
Stopped WSearch service and killed SearchHost.exe write still failed
Wrote a different, brand-new value name in the same key failed
Modified an existing value (WebSearchInstalledVersion) failed
Created a new subkey succeeded (so it is specifically value writes that are blocked)
Wrote HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search succeeded (proves elevation is fine)
Wrote HKCU\...\Explorer\Advanced succeeded (proves general HKCU writes are fine)

SearchSettings has no policy mirror on this build (HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\SearchSettings does not exist), so there is no supported policy-based way to set this value either.

Expected result

Either of:

  1. SearchHighlightOff should be marked BestEffort = $true, like the WidgetServiceOff step in the very same file, so a platform-protected cosmetic setting cannot abort the whole run; or
  2. If the value is genuinely un-writable on current builds, the step should be removed or its apply-path changed to a supported API.

Suggested fix

In windows-dev-config/steps/registry-taskbar-search.ps1, the file already acknowledges this exact class of problem for Widgets:

# Windows may protect the Widgets policy even from an administrator.
@{
    Name        = 'WidgetServiceOff'
    KeyPath     = 'HKLM\SOFTWARE\Policies\Microsoft\Dsh'
    ValueName   = 'AllowNewsAndInterests'
    Value       = 0
    Description = 'Disable Widgets'
    BestEffort  = $true
}

The SearchHighlightOff tweak immediately above it has the same exposure but lacks the flag:

@{
    Name        = 'SearchHighlightOff'
    KeyPath     = 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\SearchSettings'
    ValueName   = 'IsDynamicSearchBoxEnabled'
    Value       = 0
    Description = 'Disable Show search highlights'
}

Adding BestEffort = $true (or removing the tweak) would let Full continue on builds where Windows protects this key.

Additional notes

  • Verified against the current main: steps/registry-taskbar-search.ps1 is byte-identical to the copy setup installed, so the issue is present in the latest code.
  • Related prior report: #109 ("Disable Widget service errors on fresh Windows 11 PC") — the same class of failure, which is presumably why WidgetServiceOff was given BestEffort. SearchHighlightOff appears to have been missed.
  • No existing issue appears to cover IsDynamicSearchBoxEnabled / SearchSettings specifically.
主要語言
PowerShell
星號
2.2k
分支
168
平均合併
6 小時 48 分鐘
30 天內合併 PR
12

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoft/WindowsDeveloperConfig 的其他 Issue

查看 microsoft/WindowsDeveloperConfig 的全部 Issue

相似的 Issue

更多 Operating Systems Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。