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

New feature exclude apps from major/minor updates #711

Closed
wants to merge 10 commits into from

Conversation

FaserF
Copy link
Contributor

@FaserF FaserF commented Sep 23, 2024

Proposed Changes

We have some applications where we cannot update the applications without validating them first. But we would like to get patch updates (1.0.2 : 1=Major, 0=Minor, 2=Patch) for security reasons f.e.
This feature implements an option to exclude specific apps from Major updates or Minor Updates.

It has been tested with two applications (Meazure.GuardianBrowser & Mozilla.Firefox), one user app, one system app. Wildcards seem not to work unfortunatly (yet).

Test Log Output:

#################################################################
#  23.09.2024 - CHECK FOR APP UPDATES (System context - No ServiceUI)
#################################################################
15:39:32 - Notification Level: SuccessOnly. Notification Language: Deutsch
15:39:32 - Checking internet connection...
15:39:32 - Connected !
15:39:32 - Winget Version: v1.8.1911
15:39:32 - WAU current version: 1.21.8
15:39:32 - WAU AutoUpdate is Enabled.
15:39:32 - WAU is up to date.
15:39:32 - WAU uses Black List config
15:39:33 - -> Successsfully loaded local excluded apps list.
15:39:33 - -> Successsfully loaded local excluded major update apps list.
15:39:33 - -> Successsfully loaded local excluded patch update apps list.
15:39:33 - Checking application updates on Winget Repository...
-> Available update : Mozilla Firefox (x64 de). Current version : 129.0.2. Available version : 130.
-> Available update : Microsoft Edge. Current version : 127.0.2651.105. Available version : 129.0.2792.52.
15:39:34 - MajorUpdateToSkip: Google.AndroidStudio Meazure.GuardianBrowser Mozilla.Firefox - Detected current Major 129 and new Major: 
15:39:34 - MinorUpdateToSkip: Google.AndroidStudio Meazure.GuardianBrowser - Detected current Minor 0 and new Minor: 
15:39:34 - Mozilla Firefox (x64 de) : Skipped upgrade because it is a Major update (Current: 129.0.2, Available: 130) and excluded in Major Update list
15:39:34 - Microsoft Edge : Skipped upgrade because it is in the excluded app list
15:39:34 - No new update.
15:39:35 - User logged on, get a list of installed Winget apps in System context...
15:39:36 - Starting WAU in User context...
#################################################################
#  23.09.2024 - CHECK FOR APP UPDATES (User context)
#################################################################
15:39:39 - Notification Level: SuccessOnly. Notification Language: Deutsch
15:39:39 - Checking internet connection...
15:39:39 - Connected !
15:39:40 - Winget Version: v1.8.1911
15:39:40 - WAU current version: 1.21.8
15:39:40 - WAU uses Black List config
15:39:40 - -> Successsfully loaded local excluded apps list.
15:39:40 - -> Successsfully loaded local excluded major update apps list.
15:39:40 - -> Successsfully loaded local excluded patch update apps list.
15:39:40 - Checking application updates on Winget Repository...
-> Available update : Dev Home. Current version : 0.1800.625.0. Available version : 0.1801.625.0.
-> Available update : Guardian Browser 1.14.0. Current version : 1.14.0. Available version : 1.15.2.
15:39:41 - Dev Home : Skipped upgrade because it is in the excluded app list
15:39:41 - MajorUpdateToSkip: Google.AndroidStudio Meazure.GuardianBrowser Mozilla.Firefox - Detected current Major 1 and new Major: 1
15:39:41 - MinorUpdateToSkip: Google.AndroidStudio Meazure.GuardianBrowser - Detected current Minor 14 and new Minor: 15
15:39:41 - Guardian Browser 1.14.0 : Skipped upgrade because it is a Minor update (Current: 1.14.0, Available: 1.15.2) and excluded in Minor Update list
15:39:41 - No new update.
15:39:41 - End of process!

Related Issues

(Github link to related issues or pull requests)

@FaserF
Copy link
Contributor Author

FaserF commented Oct 21, 2024

GPOs are now also supported. this PR also adds german translations for the GPOs

@Romanitho
Copy link
Owner

Isn't it a bit too complex?
What happens if a new major or minor version is released? Will all the patch versions in between be skipped since they won't be returned as the latest version by Winget, and therefore never applied?
I think this feature should be part of Winget itself I guess

@FaserF
Copy link
Contributor Author

FaserF commented Oct 21, 2024

We have the following issue. Our developers use Android Studio and they need to develop on a specific minor version until finished, but small patches should be installed (due to hotfix / security reasons).
Meaning the following scenaros if version 2024.1 is installed and the latest version is 2024.2.2 and version 2024.1.3 exists:

  • Just default WAU: will be updated to 2024.2.2
  • Using Exclusion from Major updates: will be updated to 2024.2.2
  • Using Exclusion from Minor updates: will be updated to 2024.1.3 (if no newer version has been available at that date)
  • Using Exclusion from Minor updates: will stay at the version

To answer your question. In that scenaro the software will stay on the "old" version.

I think this wont make sense directly at winget, as winget doesnt manage updates, this is what WAU is doing.

@Romanitho
Copy link
Owner

Romanitho commented Oct 21, 2024

Winget does manage updates, but not automatically or in a seamless way. For example, you can manually run winget upgrade --all. However, if the editor updates an app with a Major or Minor tag, your app will no longer receive hotfixes in that case.

That's why I mentioned it as a winget issue. They should introduce a feature in the winget upgrade command that allows users to specify whether they want to upgrade only Major, Minor, or Patch versions (assuming the app follows this kind of versioning).

@FaserF
Copy link
Contributor Author

FaserF commented Oct 21, 2024

But how should it be implemented in winget, if winget has no update function (only upgrade all, which just upgrades all apps, with no restrictions).
In my opinion it still should be handled by WAU and not winget. I mean in the end it works already with this PR. I can still reach in a feature request, but I dont expect much attention from Microsoft.

@Romanitho
Copy link
Owner

We use WAU to update apps with Winget upgrade "AppName". It would be great if they could implement an option like Winget upgrade "AppName" --PatchOnly for instance. This way, we could easily manage patch versions since, when the editor releases a new major or minor version, the patched version may no longer be available.

@FaserF
Copy link
Contributor Author

FaserF commented Oct 22, 2024

I have now created the feature request at winget, but I dont think this will be worked on. Any way to still implement it at WAU and drop it when MS provides a official way or do I have to drop this PR and figure out another way without WAU/winget supporting it (most likely I would create a PR at winget, but this will be wayyyy more work for me)?

@Romanitho
Copy link
Owner

To be honest, I'm not sure what the best option is. From my point of view, it’s a lot of work on your part for potentially limited gain in WAU. Alternatively, we would need to implement a full check to only retrieve available hotfixes from the Winget repository. However, that would require querying all possible app versions just to find patched releases.

@FaserF
Copy link
Contributor Author

FaserF commented Oct 22, 2024

The input from the above MS request was good, I think this makes this PR obsolete, but we still need #746 to be merged for this to work. I will continue my work there

@FaserF FaserF closed this Oct 22, 2024
@Romanitho
Copy link
Owner

Oh good, I wasn't aware of that feature... That's a very good point, and we can try to address it soon. We'll probably need to review all the code that calls Winget. :/

@Romanitho
Copy link
Owner

Maybe you can use Mods to "pin" apps in system context. @KnifMelti, should be possible I guess?
This way, we can pin apps in a static major/minor, and WAU should update patches only. I'll try to test that.

@FaserF
Copy link
Contributor Author

FaserF commented Oct 23, 2024

@Romanitho please be sure to check my latest commits at #746 before, in theory it works now, WAU wil be able to handle pinned apps and udate them only if the pinned version is lower than the last available version.
we can pin apps like this:

winget pin add "Microsoft.Office" --version 16.0.*
winget pin list
Name                                      ID                    Version          Quelle Stecknadeltyp Angeheftete Version
-------------------------------------------------------------------------------------------------------------------------
Snagit 2020                               TechSmith.Snagit.2020 20.1.8           winget Pinning
Microsoft 365 Apps for Enterprise - de-de Microsoft.Office      16.0.17928.20216 winget Gating        16.0.*

this will result in WAU updating the app as long as the version is lower than 16.1 for example.

still would be great to somewhat use WAU to pin apps, for the beginning in our company I would have written a small script to pin apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants