Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: youtube-music: Duplicate start menu shortcuts #14627

Open
3 tasks done
nofishleft opened this issue Dec 23, 2024 · 0 comments
Open
3 tasks done

[Bug]: youtube-music: Duplicate start menu shortcuts #14627

nofishleft opened this issue Dec 23, 2024 · 0 comments
Labels

Comments

@nofishleft
Copy link

nofishleft commented Dec 23, 2024

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues/PRs to ensure it has not already been reported or fixed.
  • I have verified that I am using the latest version of Scoop and corresponding bucket.

Package Name

youtube-music

Current Behaviour

A minor issue where both scoop and youtube-music create their own start menu shortcuts.

  • When youtube-music is installed through scoop it creates a shortcut here
    • %AppData%\Microsoft\Windows\Start Menu\Programs\Scoop Apps\YouTube Music.lnk
  • Everytime youtube-music is opened, it will create/recreate/update a shortcut here
    • %AppData%\Microsoft\Windows\Start Menu\Programs\YouTube Music.lnk
  • After installing through scoop, and opening the application, there will be 2 start menu entries.

Normally, if the shortcuts are identical, windows will only show one of them in the start menu. However they aren't:

Description/comment differs:

AppID differs:

PS C:\Users\OEM> Get-StartApps | Where-Object {$_.Name -like "YouTube Music"}

Name          AppID
----          -----
YouTube Music com.github.th-ch.youtube-music
YouTube Music C:\Users\OEM\scoop\apps\youtube-music\current\YouTube Music.exe

Deleting the shortcut created by youtube-music isn't a solution, as it will be recreated when the app next opens.
Deleting the shortcut created by scoop is a temporary solution, but it will be recreated when the app is updated.

Aside:

Steps to Reproduce

  1. Install, reset or update youtube-music
PS C:\Users\OEM> scoop reset youtube-music
Resetting youtube-music (3.6.2).
Linking ~\scoop\apps\youtube-music\current => ~\scoop\apps\youtube-music\3.6.2
Creating shortcut for YouTube Music (YouTube Music.exe)
  • A shortcut now exists here C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Scoop Apps\YouTube Music.lnk
  • One instance of youtube-music exists in start menu
  1. Open youtube-music
  • A shortcut now exists here C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\YouTube Music.lnk
  • Two instances of youtube-music exists in start menu

Possible Solution

Idea 1

If possible to change the description/comment and the AppID of the shortcut created by scoop, then having that match should cause windows to only show 1 of the shortcuts.

Description/Comment:
https://github.com/th-ch/youtube-music/blob/d91d493dd18827370931cc11f80188d42e5a354e/src/index.ts#L671

AppID:
https://github.com/th-ch/youtube-music/blob/d91d493dd18827370931cc11f80188d42e5a354e/src/index.ts#L636

Idea 2

If possible to change the directory where the shortcut is created, use the same directory, instead of the Scoop Apps subdirectory. When the app is run, it should see the existing shortcut, and not create a second one. If the shortcut has incorrect details, it would overwrite/replace the one created by scoop.

Idea 3

Post install symlink
Link: %AppData%\Microsoft\Windows\Start Menu\Programs\YouTube Music.lnk
Target: %AppData%\Microsoft\Windows\Start Menu\Programs\Scoop Apps\YouTube Music.lnk

Afaik symlinks are resolved by the filesystem, and shortcuts are just .ink files. So calling readShortcutLink should work fine. And if the shortcut needs to be updated (description change, etc.) writeShortcutLink when called with update should also work fine.

Idea 4

If th-ch/youtube-music#2760 gets implemented, then add a post install step to set this config option.

Scoop and Buckets Version

PS C:\Users\OEM> scoop --version
Current Scoop version:
859d1db5 (HEAD -> master, tag: v0.5.2, origin/master, origin/HEAD) chore(release): Bump to version 0.5.2 (#6080)

'main' bucket:
89b59ca1a (HEAD -> master, origin/master, origin/HEAD) tenv: Update to version 4.0.1

'extras' bucket:
6d6e0a923 (HEAD -> master, origin/master, origin/HEAD) sqlitestudio: Update to version 3.4.12

Scoop Config

PS C:\Users\OEM> scoop config

last_update                       scoop_repo                              scoop_branch
-----------                       ----------                              ------------
2024-12-23T16:55:27.2926868+13:00 https://github.com/ScoopInstaller/Scoop master

PowerShell Version

PS C:\Users\OEM> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.4391
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.4391
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional Softwares

No response

@nofishleft nofishleft added the bug label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant