ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
20.32k stars 1.37k forks source link

Option to not add shortcuts to startmenu when installing a package #6031

Open insertokername opened 5 days ago

insertokername commented 5 days ago

Description

Added an option to skip creating the startmenu shortcuts when installing a package.

Motivation and Context

This is really useful in a fer specific use cases, for example i have two scoop installations on my pc for various purposes. This flag really helps avoid conflicts between installs and also because the paths of my installs are manually managed this, again, helps a lot.

How Has This Been Tested?

Ran the flag on multiple packages installs. The code is really quite simple and only interacts with a small portion of the codebase.

Checklist:

qwertyhjklxyz commented 4 days ago

Running scoop update|reset <app> still creates the shortcut. Running scoop uninstall <app> removes the shortcut, even if it was not created. Maybe add this option to install.json.

insertokername commented 4 days ago

Thank you for the help! I made some additions to hopefully fix my oversights!

After making these changes i observed some strange behavior, even if there is no startmenu shortcut in the actual folder windows still adds the program to the startmenu directly from the scoop/apps folder. I suspect this might be from registry tomfoolery that is made by the installer but i am not sure. If you have any ideas they would be greatly appreciated!

Another thing i would like to mention is that shims also get added to the startmenu, i intend to not interfere with this since you can already manage shims through scoop shim and this option is intended to only affect the startmenu folder.

qwertyhjklxyz commented 4 days ago

After making these changes i observed some strange behavior, even if there is no startmenu shortcut in the actual folder windows still adds the program to the startmenu directly from the scoop/apps folder. I suspect this might be from registry tomfoolery that is made by the installer but i am not sure. If you have any ideas they would be greatly appreciated!

Do you mean apps in the nonportable repository, scoop just calls installer and doesn't control the behavior of the installer, but it is possible to remove shortcuts in the post_install.

Another thing i would like to mention is that shims also get added to the startmenu, i intend to not interfere with this since you can already manage shims through scoop shim and this option is intended to only affect the startmenu folder.

Scoop doesn't add shim to the startmenu.

By the way, you didn't update the scoop-update.ps1. scoop-export.ps1 and scoop-import.ps1 seem to need updating as well.

insertokername commented 3 days ago

Do you mean apps in the nonportable repository, scoop just calls installer and doesn't control the behavior of the installer, but it is possible to remove shortcuts in the post_install.

Noted, thank you for the help!

Scoop doesn't add shim to the startmenu.

I accidentally confused the startmenu for the search, sorry!

I pushed a fix for the update and the import, hope it addresses all issues! Thank you for your patience with me, this is my second ever contribution with actual code so sorry for the mistakes.