Refactor architecture handling for app downloads

Clarifies the distinction between the application architecture to be downloaded and the target Windows architecture for installer pruning.

Renames the `SelectedWindowsArch` parameter to `WindowsArch` and introduces a new `ApplicationArch` parameter. This makes the download and subsequent installer selection logic more explicit and easier to understand, especially for MS Store apps where multiple installers might be available.
This commit is contained in:
rbalsleyMSFT
2025-08-22 18:47:43 -07:00
parent 3f892493c0
commit 3e34bd6bff
3 changed files with 16 additions and 16 deletions
@@ -386,7 +386,7 @@ function Start-WingetAppDownloadTask {
[string]$OrchestrationPath,
[Parameter(Mandatory = $true)]
[System.Collections.Concurrent.ConcurrentQueue[hashtable]]$ProgressQueue, # Add queue parameter
[string]$SelectedWindowsArch
[string]$WindowsArch
)
$appName = $ApplicationItemData.Name
@@ -596,7 +596,7 @@ function Start-WingetAppDownloadTask {
try {
# Call Get-Application
$resultCode = Get-Application -AppName $appName -AppId $appId -Source $source -AppsPath $AppsPath -WindowsArch $ApplicationItemData.Architecture -OrchestrationPath $OrchestrationPath -SkipWin32Json -SelectedWindowsArch $SelectedWindowsArch -ErrorAction Stop
$resultCode = Get-Application -AppName $appName -AppId $appId -Source $source -AppsPath $AppsPath -ApplicationArch $ApplicationItemData.Architecture -WindowsArch $WindowsArch -OrchestrationPath $OrchestrationPath -SkipWin32Json -ErrorAction Stop
# Determine status based on result code
switch ($resultCode) {
@@ -718,7 +718,7 @@ function Invoke-WingetDownload {
AppsPath = $localAppsPath
AppListJsonPath = $localAppListJsonPath
OrchestrationPath = $localOrchestrationPath
SelectedWindowsArch = $localWindowsArch
WindowsArch = $localWindowsArch
}
# Select only necessary properties before passing to Invoke-ParallelProcessing