From 37608a338c20b8db3208e7a2bb1b5c13c6e7ab71 Mon Sep 17 00:00:00 2001 From: Nils <52573120+niStee@users.noreply.github.com> Date: Mon, 29 Jan 2024 02:02:40 +0100 Subject: [PATCH] Fix/usoclient (#669) * cargo update * Implementing a check for Windows 11 and, if detected, skipping Windows Update via usoclient.exe. It is suggested to install PSWindowsUpdate. * Revert "cargo update" This reverts commit 43a4d321cfc6381ac41f413131b2a9822c20e0b9. * Revert "Implementing a check for Windows 11 and, if detected, skipping Windows Update via usoclient.exe. It is suggested to install PSWindowsUpdate." This reverts commit e1ef2e4bc5385b8bc8f60b3e7faeb044c9472d0c. * Removed the usoclient step and added an error message. * cargo fmt --- src/steps/os/windows.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/steps/os/windows.rs b/src/steps/os/windows.rs index a459584f..2b5054c3 100644 --- a/src/steps/os/windows.rs +++ b/src/steps/os/windows.rs @@ -209,18 +209,14 @@ pub fn windows_update(ctx: &ExecutionContext) -> Result<()> { if powershell.supports_windows_update() { print_separator("Windows Update"); - return powershell.windows_update(ctx); + powershell.windows_update(ctx) + } else { + Err(SkipStep( + "Consider installing PSWindowsUpdate as the use of Windows Update via usoclient is not supported." + .to_string(), + ) + .into()) } - - let usoclient = require("UsoClient")?; - - print_separator("Windows Update"); - println!("Running Windows Update. Check the control panel for progress."); - ctx.run_type() - .execute(&usoclient) - .arg("ScanInstallWait") - .status_checked()?; - ctx.run_type().execute(&usoclient).arg("StartInstall").status_checked() } pub fn reboot() -> Result<()> {