1f09fa8691 Fix bugs found in a code audit (#5188)
* fix(packages): install every ID in semicolon-separated choco entries

applications.json githubdesktop has choco "git;github-desktop", but Get-WinUtilSelectedPackages passed the whole string to choco as one package name, so install and uninstall always failed under the Choco preference. Detection in Invoke-WinUtilCurrentSystem already splits on ";". Split in Add-PackageId so install and detection agree.

* fix(tweaks): undo services only when still at applied type

KeepServiceStartup skipped a service on apply when its startup type was changed by the user, but undo forced the static OriginalType back regardless, overwriting the user setting that apply deliberately left alone. Undo now uses the same guard in reverse: only restore OriginalType when the service still sits at the applied StartupType.

* fix(iso): treat a failed source-ISO dismount as an error

Two Dismount-DiskImage calls in the modify path lacked -ErrorAction Stop, unlike the existing call sites at lines 185 and 291. A non-terminating dismount failure (device busy) was swallowed, $modified was set anyway, and the finally-block dismount cleanup was skipped, leaving the source ISO mounted with no feedback.

* fix(features): continue past a failed optional feature

Enable-WindowsOptionalFeature ran with -ErrorAction Stop and no per-feature catch, so one feature missing on the current edition (e.g. Windows Sandbox on Home) aborted the whole selection. Each feature now fails independently and logs an error.

* fix(tweaks): drop nonexistent wermgr service, use REG_SZ types

Set-Service wermgr targets a service that does not exist. Invoke-WinUtilScript runs the script block with -ErrorAction Stop, so the failing Set-Service aborted the rest: apply never set POWERSHELL_TELEMETRY_OPTOUT or removed PeriodInNanoSeconds, and undo never restored them.

Also fix MouseSpeed/MouseThreshold1/MouseThreshold2 and KeyboardDelay to Type String: Windows stores these Control Panel values as REG_SZ, and writing them as DWord changed the value type, which the settings UI can ignore.

* fix(tweaks): guard diagtrack, drop taskbar keys from Visual Effects

WPFTweaksTelemetry disabled diagtrack through InvokeScript/UndoScript, bypassing the KeepServiceStartup guard that service entries get, and undo forced Automatic regardless of what the user had set. diagtrack is now a service block entry, so apply and undo go through Set-WinUtilService with the guard.

WPFTweaksDisplay (Visual Effects - Set to Best Performance) also set ShowTaskViewButton and SearchboxTaskbarMode to 0 with OriginalValue 1, while WPFToggleTaskView/WPFToggleTaskbarSearch own the same values with the opposite originals: one undo path always wrote a guessed value over the user setup, and taskbar visibility is not a visual effect. Removed both entries from WPFTweaksDisplay; the toggles remain the sole owners.

Adds a configs test asserting no two tweaks claim the same registry value with conflicting OriginalValue or Type.

* fix(tweaks): guard Set-Service calls in config scripts

WPFTweaksWindowsAI and WPFTweaksRemoveOneDrive called Set-Service unguarded inside scripts that Invoke-WinUtilScript runs with -ErrorAction Stop. WSAIFabricSvc only exists on some Windows 11 builds, so on machines without it the failing Set-Service aborted the block and Disable-WindowsOptionalFeature for Recall never ran. Each Set-Service is now wrapped in a Get-Service existence check, and a configs test keeps future config scripts guarded.

* fix(appx): report an install with no source as a failed result

Install-WinUtilAPPX threw when a package had no local manifest and no StoreId, and Invoke-WPFAppxInstall had no per-package catch: selecting any of the three appx.json entries without a StoreId aborted the whole job, skipped every remaining selected package, and never reached Complete-WinUtilPackageRun. The no-source case now returns a Failed result like the choco and winget paths, so the batch completes, the summary names the package, and Complete-WinUtilPackageRun still fails the job. Unexpected errors continue to surface to the job layer.

* Document partial failures and service undo limits accurately

* Keep dependencies installed when uninstalling their app

* Skip dependent scripts when a Windows feature fails

* Check OneSyncSvc template existence through the registry

---------

Co-authored-by: foxbyte <198093090+adiraj66132@users.noreply.github.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2026-10-21 15:12:18 -05:00
…
2024-08-30 09:48:21 -05:00
2026-10-19 10:35:04 -05:00
2025-05-23 11:26:48 -05:00

Chris Titus Tech's Windows Utility

Version Downloads Discord

A curated compilation of Windows system tasks streamline installs, debloat with tweaks, troubleshoot with config, and configure Windows updates. Run it fresh on every new Windows install.

Title Screen


Quick Start

WinUtil must be run as Administrator because it performs system-wide changes.

Open PowerShell or Terminal as admin, then run:

Stable Branch (recommended)

irm https://christitus.com/win | iex

Development Branch

irm https://christitus.com/windev | iex

How to open an admin terminal

  • Start menu: Right-click Start → Windows PowerShell (Admin) or Terminal (Admin)
  • Search: Press the Windows key, and type PowerShell or Terminal, then Ctrl + Shift + Enter

Automation / Presets

Apply a predefined configuration without manual selection:

& ([ScriptBlock]::Create((irm https://christitus.com/win))) -Preset Standard
Preset Description
Standard Balanced defaults for most users
Minimal Minimal changes to suit every user
Advanced Deep tweaks for power users

To view exactly what each preset does, see: https://github.com/ChrisTitusTech/winutil/blob/main/config/preset.json


Build & Develop

See https://github.com/ChrisTitusTech/winutil/blob/main/.github/CONTRIBUTING.md


Resources


Support

Sponsors

These are the sponsors that help keep this project alive with monthly contributions.

User avatar: User avatar: MartinUser avatar: Jason A. DiegmuellerUser avatar: RMSUser avatar: PaulUser avatar: Dave J  (WhamGeek)User avatar: Anthony MendezUser avatar: User avatar: DursleyGuyUser avatar: User avatar: Kiera MeredithUser avatar: Sean (ANGRYxScotsman)User avatar: José EncarnaçãoUser avatar: TomandesMSH

*Sponsors with a recurring subscription also get access to the .NET alternative.


Contributors

Contributors

Thanks to everyone who has contributed time and effort to this project. Keep rocking 🍻

S
Description
No description provided
Readme MIT
42 MiB
0 Stars 1 Watchers 0 Forks
Languages
PowerShell 96.7%
Python 3.3%