Windows tray icon identity
The problem
After a Scoop update the tray icon dropped back into the hidden overflow even though the user had set it to “always show”. Windows stores the per-icon “always show” flag underHKCU\Control Panel\NotifyIconSettings, keyed on the icon’s identity. Without NIF_GUID, that identity is the exe path plus a per-process uID. Scoop installs every version into its own directory (scoop\apps\echophrase\<version>\), so each update looks like a brand-new icon. winget and the plain installer use a fixed path and were not affected.
Microsoft’s rule (NOTIFYICONDATA troubleshooting): an icon registered with a guidItem keeps its settings across a path change only if the old and new binaries are Authenticode-signed by the same publisher.
What the app does
- Fixed GUID.
src-tauri/src/setup/tray.rsdefinesTRAY_ICON_GUIDand passes it totray_icon::set_default_guidbefore the icon is built. Never change it, and never reuse it for a second icon. - Patched
tray-icon. Tauri’s crate does not supportguidItem. The workspaceCargo.tomlhas a[patch.crates-io]entry that pointstray-iconat a fork pinned to a commit. The fork istray-icon0.24.2 plus upstream PR tauri-apps/tray-icon#366 plus a process-wideset_default_guid, which is needed because Tauri’sTrayIconBuilderdoes not pass new attributes through. Drop the patch once the PR ships and Tauri exposeswith_guid. See ADR 0004. - Signed app exe. When signing is configured, the release build signs
echophrase.exeitself (through the Windows bundle’ssignCommand), not only the installer. Without that, the GUID would not help across path changes.