fix: repair popup install binding, dialog titles, presets switch, radio groups, JSON, tests (#4893)

* fix: repair popup install binding, dialog titles, presets switch, radio groups, JSON, tests

- Invoke-WPFInstall: add param block so the right-click app popup binds
  -PackagesToInstall. It previously dropped the argument into $args and
  installed the whole selected list instead of the clicked app (or warned
  that nothing was selected).
- Replace undefined $AppTitle with "WinUtil" in Install/UnInstall warning
  boxes, matching the XAML window title and sibling dialogs.
- tweaks.json: remove stray nested "link" inside the WPFToggleScrollbars
  registry entry (dead property; registry entries expose only the six
  consumed fields).
- Invoke-WPFPresets: fix dead switch cases to the wildcard-pattern
  convention so selectedFeatures/selectedToggles clear correctly.
- Invoke-WPFUIElements: store the group StackPanel in radioButtonGroups so
  grouped radio buttons share one container (else branch was unreachable).
- sanity.Tests.ps1: pass the Windows PowerShell parser script via
  -EncodedCommand; -Command string marshaling corrupted backticks/quotes and
  produced false parse failures.
- install-workflow.Tests.ps1: remove the AppTitle workaround and update
  title assertions to "WinUtil"; drop orphaned cleanup lines.
- Add CHANGES.md with technical and plain-language explanations.

Verified: each bug reproduced against HEAD, fixes demonstrated to change
behavior, full Pester suite 471/471.

* Delete

* test: cover the explicit popup install parameter path

Add a regression test invoking Invoke-WPFInstall -PackagesToInstall with a
package different from the default sync.selectedApps selection and assert
the runspace receives the explicit object, mirroring the Initialize-WPFUI
popup call shape. Existing default-path coverage is unchanged.
This commit is contained in:
Mohammad Faiz
2026-08-03 12:03:03 -05:00
committed by GitHub
parent f3cf1587e0
commit f7361fdb72
7 changed files with 35 additions and 20 deletions
+6 -4
View File
@@ -3,19 +3,21 @@ function Invoke-WPFInstall {
.SYNOPSIS
Installs the selected programs using winget, if one or more of the selected programs are already installed on the system, winget will try and perform an upgrade if there's a newer version to install.
#>
$PackagesToInstall = $sync.selectedApps | Foreach-Object { $sync.configs.applicationsHashtable.$_ }
param(
[Parameter(Mandatory = $false)]
[PSObject[]]$PackagesToInstall = $($sync.selectedApps | Foreach-Object { $sync.configs.applicationsHashtable.$_ })
)
if($sync.ProcessRunning) {
$msg = "[Invoke-WPFInstall] An Install process is currently running."
Show-WinUtilMessage -Message $msg -Title "Winutil" -Button "OK" -Icon "Warning"
Show-WinUtilMessage -Message $msg -Title "WinUtil" -Button "OK" -Icon "Warning"
return
}
if ($PackagesToInstall.Count -eq 0) {
$WarningMsg = "Please select the program(s) to install or upgrade."
Show-WinUtilMessage -Message $WarningMsg -Title $AppTitle -Button "OK" -Icon "Warning"
Show-WinUtilMessage -Message $WarningMsg -Title "WinUtil" -Button "OK" -Icon "Warning"
return
}