-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Pin a package #476
Comments
From my experience the most common scenario for why you'd want to pin a package version is when there is a known issue with a newer version of that package itself or with one if its dependencies. So on Linux that meant I pinned the docker package because one of its dependencies (containerd) could not be installed. winget must be able to resolve dependencies (once implemented) for this feature to be really useful since it needs to block the update of all packages that have the pinned package listed in their dependencies. I also like pinning because it allows me to rely on software that is prone to change a lot (for example when it's early in development) and I can rest easy that it will stay the same unless I explicitly unpin it again. |
I don't see it exactly that way. I could simply block an app, let's say NodeJS, of installing updates because I'm developing stuff that is tested only against a specific version of such package. Anyway, there's lots of use cases, specially for devs. |
That's what nvm (node version manager) is for ;-) My line of work is DevOps and most of the times this has been necessary was due to issues in operations but your experience may vary. |
I think that this might be related or something need to be put in place to support software versions that are higher than the repo versions.
The Client then opens and updates itself to the latest beta version and shows the same results as before.
Maybe this is just something wrong with the packages and this functionality is not needed, but Discord.Discord , GOG.Galaxy, EpicGames.EpicGamesLauncher all have this issue. |
As a note, please don't block pinning of packages that are known to self-update / have own updaters. I'm using package pinning in chocolatey also for packages, which I want to update via another mechanism than chocolatey itself. I think this is a valid use case too. |
Two more usecases (well one and a half):
|
Personally, I'd like to block Python as I got multiple Python installations if it's needed, which it has been in the past for a few niche programs. But it wants to update all of them to latest. |
I just tried 'winget upgrade --all' for the first time and it tried to upgrade Audacity to 3+ which is now suspected for spyware. Audacity 2.4 is safe and will remain very popular. I didn't install Audacity with Winget (I used Scoop and pinned it). If Winget is going to upgrade apps installed via Scoop or Choco then we need to be able to pin. |
Pinning functionality is not present in version |
Just had the pleasure of testing the preview version, and the pinning feature is exactly what i was hoping for! |
@ksl28 we've released it in a preview as an "experimental" feature. Once this is a stable feature, we will release a version that no longer requires enabling the experimental feature. We've used this pattern in WinGet so we can continue to iterate on features until they become stable. Pinning is currently experimental so we can get user feedback on how it is working, and hopefully and bugs identified can be fixed before the feature becomes stable. The open Issues related to |
Changed my settings to: {
"$schema": "https://aka.ms/winget-settings.schema.json",
"experimentalFeatures": {
"pinning": true
}
} Still wouldn't allow me to take advantage of the feature. What other steps are needed? |
Did you update your client to the 1.5 preview release? |
A number of "please add a feature to exclude apps from update --all" issues have been closed as a duplicate of this one. I'd like to point out that they may be different things. For instance Microsoft Teams updates itself, but does not update the version number. I do not want to pin Teams at an old version, but I do want to exclude it from the all updates. |
@vrolijken Please take a look at Package Pinning Types. Your request can be catered by making the pins as |
I made a python script that doesn't require external libraries to help with this. It seems to work. Feedback appreicated. |
I'm puzzled by the pinning behavior I'm seeing in WinGet 1.6.1573-preview. Yesterday, a WinGet package for a nightly build of Node.js was released. I'd prefer to wait for an official release, so added a "gating" pin via
But subsequent calls to
The issue appears to be that WinGet allows that nightly build to be displayed since its version doesn't match the gating Or am I missing something here? |
@dschulman-repay For the specific case of Node.js nightly builds, the nightly builds have been removed from the winget-pkgs repo, so they shouldn't show up anymore. Correct handling of nightly and stable versions would be covered by #147 But the pinning thing is weird. What you expected should have been what happened; gating it to |
Currently I'm a big fan of the workaround where I just... don't accept the admin prompt for programs I don't want to attempt an update for. edit: /s |
very bad workaround, not every app needs an UAC prompt and the workaround is interactive only, also how can you say big fan when this is a mediocre workaround at best |
@MagicAndre1981 Nope, tried that as well. Note that both |
|
Is it possible to exclude a current version? |
Just for future reference: Examples:
Pinning could still exist, but above scheme would be more in line how the CLI is excepted to work. Looking at other package managers you often want this possibility at the time of install instead of pinning it (which I assume is) globally. |
Description of the new feature/enhancement
Users should be able to prevent the Windows Package Manager from updating a package (assumes the package doesn't have it's own auto-update).
winget pin <package>
and the corollarywinget unpin <package>
.This was mentioned by:
@megamorf #120 (comment)
@rodalpho #120 (comment)
@aetos382 #120 (comment)
@kmindi #120 (comment)
Proposed technical implementation details (optional)
There should also be a mechanism to display the packages (and the version) that have been "pinned". This might be a function of list or a function of pin. Additionally, if packages are known to self-update (like Visual Studio Code) an additional meta-data entry in the manifest could help users understand when they may not be able to pin a package.
Edit: Clarifying behavior for ambiguity suggested in other Issues.
Pinning should enable users to specify the exact version (likely the default case with no parameters).
It should also allow users to specify what portion of a version should be pinned so bug fixes could be applied, or even minor version bumps.
Assume the user has installed "Awesome App" version "1.2.3".
winget pin "Awesome App"
This would pin to version 1.2.3 and would not be upgraded when any newer version is released.
winget pin "Awesome App" --version 1.2
This would pin version to anything less than version 1.3. If version 1.2.4 were released this would be a valid upgrade.
winget pin "Awesome App" --version 1
This would pin the version to anything less than version 2. If version 1.2.4 were released this would be a valid upgrade. If version 1.3.0 were released this would also be a valid upgrade.
Additional example per @brainz80
The text was updated successfully, but these errors were encountered: