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

Add a flag to install/upgrade packages without creating desktop shortcuts #1045

Open
leo2d opened this issue May 31, 2021 · 8 comments
Open
Labels
Area-Manifest This may require a change to the manifest Area-Settings Issue related to WinGet Settings Issue-Feature This is a feature request for the Windows Package Manager client.

Comments

@leo2d
Copy link

leo2d commented May 31, 2021

Description of the new feature/enhancement

Add a new flag to give the user the option to add/ upgrade a package without creating a desktop shortcut

I think there are many people out there that, like me, love to keep their desktops clean, without any shortcuts.
So every time I run "winget upgrade --all" I need to go to the desktop and manually delete all the created shortcuts.
The same happens when adding a new package or upgrading a specific one.

What I do believe will help a lot it's a new flag. Something like "-ns"(no shortcut). So the final command should be something like "winget upgrade --all -ns".

Proposed technical implementation details (optional)

At this point, I don't know the complexity of this task in terms of implementation.

The winget-cli is already an amazing tool and I like it a lot. I believe this feature could make the winget even better, but again, I don't know how complex it could be as every installer is different from the others.

@leo2d leo2d added the Issue-Feature This is a feature request for the Windows Package Manager client. label May 31, 2021
@ghost ghost added the Needs-Triage Issue need to be triaged label May 31, 2021
@gmoises
Copy link

gmoises commented Jun 1, 2021

And have an option to designate destination for the shortcut, maybe the user uses the Quick Launch folder.

@denelon denelon removed the Needs-Triage Issue need to be triaged label Jun 1, 2021
@KaranKad
Copy link

Some installers don't have switches to not create a desktop shortcut/start menu shortcut, it is only possible by using interactive installation but that defeats purpose of using winget. Some installers don't even give option to not create desktop shortcut.
So here is what I'm suggesting.

In .yaml manifest file, there should be two fields for desktop shortcut and start menu shortcut, possibly in installer.yaml
where desktop shortcut includes location to where the installer will create shortcut and so on for start menu shortcut

Here is what it should look like in Publisher.App.installer.yaml

Shortcut:
  Desktop: "C:\Users\<username>\Desktop\App.lnk"
  StartMenu: "C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\App.lnk"

These fields should contain wherever the installer creates following shortcuts. Person who submits the package needs to take care of that.
With this winget will now know where this installer created shortcut.
Lets assume in winget settings I have set it to not create desktop shortcut, just start menu shortcut. Then It should look something like this.

    "installBehavior": {
        "preferences": {
            "desktopshortcut": "no",
            "startmenushortcut": "yes"
        }
    },

As desktopshortcut is set to no, winget should check if the installer created a shortcut or no, if created then it should delete it. winget should also check if the installer created a shortcut when using winget upgrade App and delete it if so.
Doesn't sound like most elegant solution but I don't see any other way.

@sredna
Copy link
Contributor

sredna commented Jul 26, 2021

Deleting files on the users machine seems rather risky, the manifest schema must enforce a specific list of approved root shell folders. Maybe just Start menu, Start Menu\Programs and Desktop. Winget would also have to check the creation date of the shortcut to make sure it only deletes new shortcuts created after Winget started.

Without bothering to look it up, I would assume that there is a Windows Logo requirement or recommendation that installers should not create shortcuts anywhere except under "Start Menu\Programs". Installer authors should be encouraged to follow reasonable guidelines.

@o-l-a-v
Copy link

o-l-a-v commented Dec 29, 2021

Adding to the complexity

  • Desktop shortcut from installers designed to run as admin or from system context, is often added to the shortcut the public folder.
  • What if a shortcut already exists before upgrade with option of no shortcut, what should winget-cli do then?

@denelon
Copy link
Contributor

denelon commented Feb 18, 2022

I haven't invested enough time to know how reasonable this feature is. I'll flag this as "Area-Settings" and "Area-Manifest" so it shows up in searches when we're looking at settings and schema changes. If someone could provide a couple of examples for packages that support this in "silent" mode, and some that don't, we can have a couple of packages to evaluate edge cases and the impact to user experience and expectations.

The manifest would need to inform us what a package does and does not support. Generally, when we add arguments and settings, things get tricky. If a user requires the behavior, it's likely to impact how many packages a user could successfully install. We would also likely want to look at the search experience if a user requires this ability so we wouldn't show them packages they couldn't install.

@denelon denelon added Area-Settings Issue related to WinGet Settings Area-Manifest This may require a change to the manifest labels Feb 18, 2022
@gmoises
Copy link

gmoises commented Feb 18, 2022 via email

@SpecterShell
Copy link
Contributor

SpecterShell commented Feb 19, 2022

Inno Setup:
/NOICONS disables start menu shortcuts
/MERGETASKS="!desktopicon,!quicklaunchicon,!startupicon" disables desktop icon, quick launch icon and startup icon.
Examples: Appest.TickTick and FancyNode.PxCook

NSIS doesn't have official switchs for shortcuts, so it rests with installer authors. 🤷
Example: Tencent.YingYongBao
/NODESKLINK No desktop icon
/NOQUICKLINK No quick launch icon

So does EXE
Example: Tencent.QQMusic
https://github.com/microsoft/winget-pkgs/blob/master/manifests/t/Tencent/QQMusic/18.22/Tencent.QQMusic.installer.yaml

@gmoises
Copy link

gmoises commented Feb 19, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Manifest This may require a change to the manifest Area-Settings Issue related to WinGet Settings Issue-Feature This is a feature request for the Windows Package Manager client.
Projects
None yet
Development

No branches or pull requests

7 participants