feat: Dynamically update Windows architecture options

Implements logic to filter the available Windows architectures based on the selected OS Release, Version, and SKU. This ensures that only valid architecture options are presented to the user.

- Adds a new function to determine the correct architectures for different Windows versions (e.g., Server, Windows 10/11, LTSC editions).
- Wires up event handlers to the Release, Version, and SKU dropdowns to refresh the architecture list when their selection changes.
- Refactors initialization to use this new dynamic logic.
This commit is contained in:
rbalsleyMSFT
2025-07-09 12:56:57 -07:00
parent 3f6661e2dc
commit 9edbcc6f01
3 changed files with 117 additions and 6 deletions
@@ -151,10 +151,29 @@ function Register-EventHandlers {
if ($null -ne $localState.Controls.cmbWindowsRelease.SelectedItem) {
$selectedReleaseValue = $localState.Controls.cmbWindowsRelease.SelectedItem.Value
}
# Only need to update the Version combo when Release changes
Update-WindowsVersionCombo -selectedRelease $selectedReleaseValue -isoPath $localState.Controls.txtISOPath.Text -State $localState
# Also update the SKU combo (now derives values internally)
Update-WindowsSkuCombo -State $localState
Update-WindowsArchCombo -State $localState
})
$State.Controls.cmbWindowsVersion.Add_SelectionChanged({
param($eventSource, $selectionChangedEventArgs)
# This event should only fire on user interaction or after Update-WindowsVersionCombo runs.
# We only need to update the architecture, as SKU is dependent only on Release.
$window = [System.Windows.Window]::GetWindow($eventSource)
if ($null -eq $window) { return } # Window might be closing
$localState = $window.Tag
Update-WindowsArchCombo -State $localState
})
$State.Controls.cmbWindowsSKU.Add_SelectionChanged({
param($eventSource, $selectionChangedEventArgs)
# This event should only fire on user interaction or after Update-WindowsSkuCombo runs.
# We only need to update the architecture.
$window = [System.Windows.Window]::GetWindow($eventSource)
if ($null -eq $window) { return } # Window might be closing
$localState = $window.Tag
Update-WindowsArchCombo -State $localState
})
$State.Controls.btnBrowseISO.Add_Click({