Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions install.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ func (i *installCmd) installUpdates(ctx context.Context) error {

installMsgPopped := i.virusDef
installingMinOneUpdate := false
anyRebootRequired := false

kbs := NewKBSet(i.kbs)
if err := initDriverExclusion(); err != nil {
Expand Down Expand Up @@ -450,6 +451,7 @@ outerLoop:
deck.InfofA("Install of KB %s; Reboot Required: %t", u.KBArticleIDs, rsp.rebootRequired).With(eventID(cablib.EvtRebootRequired)).Go()

if rsp.rebootRequired && !u.InCategories([]string{"Definition Updates"}) {
anyRebootRequired = true
deck.InfofA("Adding KB %s to reboot list.", u.KBArticleIDs).With(eventID(cablib.EvtRebootRequired)).Go()
rebootList = append(rebootList, u.KBArticleIDs...)
}
Expand All @@ -475,9 +477,11 @@ outerLoop:
}
}

if len(rebootList) > 0 {
if err := cablib.AddRebootUpdates(rebootList); err != nil {
deck.ErrorfA("Failed to write updates requiring reboot to registry: %v", err).With(eventID(cablib.EvtRebootRequired)).Go()
if anyRebootRequired || len(rebootList) > 0 {
if len(rebootList) > 0 {
if err := cablib.AddRebootUpdates(rebootList); err != nil {
deck.ErrorfA("Failed to write updates requiring reboot to registry: %v", err).With(eventID(cablib.EvtRebootRequired)).Go()
}
}

// Use active hours if enabled and available, otherwise use the standard reboot delay.
Expand Down
Loading