Skip to content

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) #6408

@hoshiizumiya

Description

@hoshiizumiya

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions