From ba523b40d68f5abf12c2a2ff952c5dce5625b0a2 Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Wed, 27 Mar 2019 16:13:11 +0000 Subject: [PATCH] (GH-1768) Ignore file rename operations check In some scenarios, this check was causing Chocolatey to always report that the system was in a pending reboot state. Even after a reboot Chocolatey would still report that it was still pending a reboot. After discussion, it was determined that this check has a history of causing problems, and as a result, the decision was made to remove it. It will still do the check, which will now only show up in the debug log, but this check will no longer go into the overall pending reboot check. --- .../infrastructure.app/services/PendingRebootService.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/chocolatey/infrastructure.app/services/PendingRebootService.cs b/src/chocolatey/infrastructure.app/services/PendingRebootService.cs index 57f88bd1c9..61f1393ed8 100644 --- a/src/chocolatey/infrastructure.app/services/PendingRebootService.cs +++ b/src/chocolatey/infrastructure.app/services/PendingRebootService.cs @@ -126,7 +126,7 @@ private bool is_pending_windows_auto_update() /// Determines whether there is a pending file rename operation waiting on reboot for lock releases. /// /// - /// true if is pending file rename operations; otherwise, false. + /// false, however, additional information provided in debug log to indicate if it was ignored. /// private bool is_pending_file_rename_operations() { @@ -140,9 +140,11 @@ private bool is_pending_file_rename_operations() result = (value as string[]).Length != 0; } - this.Log().Debug(" - Pending File Rename Operations = {0}".format_with(result ? "Flagged" : "Checked")); + this.Log().Debug(" - Pending File Rename Operations = {0}".format_with(result ? "Ignored" : "Checked")); - return result; + // Always return false, as we don't want this check to result in a pending reboot warning/error. + // Instead, this will only provide output in the debug log indicating that the check was ignored. + return false; } ///