Skip to content

Commit

Permalink
Add drivers to default update search. Only show non-hidden updates in…
Browse files Browse the repository at this point in the history
… default search. Modify -all search to find hidden, non-hidden, and driver updates.

PiperOrigin-RevId: 601206768
  • Loading branch information
Cabbie Team authored and copybara-github committed Jan 24, 2024
1 parent d3a62e9 commit ca83e2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ func (i *installCmd) criteria() (string, []string) {
var rc []string
switch {
case i.all:
c = search.BasicSearch
// Search for non-hidden updates, drivers, or hidden updates. OR is used to separate the search
// groups per
// https://learn.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdatesearcher-search
c = search.BasicSearch + " AND IsHidden=0 OR Type='Driver' OR " + search.BasicSearch + " AND IsHidden=1"
deck.InfofA("Starting search for all updates: %s", c).With(eventID(cablib.EvtSearch)).Go()
case i.drivers:
c = "Type='Driver'"
Expand All @@ -123,7 +126,7 @@ func (i *installCmd) criteria() (string, []string) {
c = search.BasicSearch
deck.InfofA("Starting search for KB's %q:\n%s", i.kbs, c).With(eventID(cablib.EvtSearch)).Go()
default:
c = search.BasicSearch
c = search.BasicSearch + " AND IsHidden=0 OR Type='Driver'"
rc = config.RequiredCategories
deck.InfofA("Starting search for general updates: %s", c).With(eventID(cablib.EvtSearch)).Go()
}
Expand Down

0 comments on commit ca83e2e

Please sign in to comment.