microsoft / microsoft/WindowsAppSDK

The system tray icon will register repeatedly if the app is updated (because the exe path changes due to the version field in the path)

Open
#6,408 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Shell UX
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

Describe the bug

The system tray icon will register repeatedly if the app is updated (because the exe path changes due to the version field in the path).
Also the registered icon registry content will not get cleaned up after uninstall. Because there is no standard msix packaged way to do such a thing, which all things are managed by the system msix installer.
Even if you keep the icon's GUID is the same, the icon information's exe path is different because it contains version information, which is like 'C:\Program Files\WindowsApps\E8B6E2B3-D2A0-4435-A81D-2A16AAF405C8_1.19.0.0_x64__k3erpsn8bwzzy' .
And I also think you should note that the GUID is also shouldn't use Path calculation, because the program directory installed in the Windows App directory is mandatory to include version information.

Steps to reproduce the bug

register: https://github.com/SnapHutaoRemasteringProject/Snap.Hutao.Remastered.Native/blob/c2592b2f4361f392337224db853263dfb03b249f/src/Snap.Hutao.Remastered.Native/HutaoNativeRegistryNotification.cpp#L98-L172
usage: https://github.com/SnapHutaoRemasteringProject/Snap.Hutao.Remastered/blob/410d900f4ddf6e7738ee2c3d0cc8fa483e6b2741/src/Snap.Hutao.Remastered/Snap.Hutao.Remastered/UI/Shell/NotifyIconController.cs#L56-L98

Expected behavior

You'll find many the same content in the registry and settings.
This causes the inconsistently behavior of the icon.

Screenshots
Image Image Image
NuGet package version

1.8.260317003

Packaging type

Packaged (MSIX)

Windows version

Insider Build (xxxxx)

IDE

No response

Additional context

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with HutaoNativeRegistryNotification.cpp at lines 98-172 and NotifyIconController.cs at lines 56-98 to trace registration and use of the executable path. Reproduce an update with the packaged MSIX, then inspect the registry and settings entries. Done means repeated registrations no longer accumulate and icon behavior remains consistent across updates, while considering the stated MSIX uninstall limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.