mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Implement code changes to enhance functionality and improve performance
This commit is contained in:
@@ -598,7 +598,7 @@ function Import-DriversJson {
|
||||
|
||||
$State.Data.allDriverModels = $State.Data.allDriverModels | Sort-Object @{Expression = { $_.IsSelected }; Descending = $true }, Make, Model
|
||||
|
||||
Filter-DriverModels -filterText $State.Controls.txtModelFilter.Text -State $State
|
||||
Filter-DriverModels -filterText $State.Controls.txtModelFilter.Text -State $script:uiState
|
||||
|
||||
$message = "Driver import complete.`nNew models added: $newModelsAdded`nExisting models updated: $existingModelsUpdated"
|
||||
[System.Windows.MessageBox]::Show($message, "Import Successful", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Information)
|
||||
@@ -1566,6 +1566,10 @@ $window.Add_Loaded({
|
||||
$script:uiState.Controls.btnBrowseOfficePath = $window.FindName('btnBrowseOfficePath')
|
||||
$script:uiState.Controls.btnBrowseDriversFolder = $window.FindName('btnBrowseDriversFolder')
|
||||
$script:uiState.Controls.btnBrowsePEDriversFolder = $window.FindName('btnBrowsePEDriversFolder')
|
||||
$script:uiState.Controls.txtAppName = $window.FindName('txtAppName')
|
||||
$script:uiState.Controls.txtAppCommandLine = $window.FindName('txtAppCommandLine')
|
||||
$script:uiState.Controls.txtAppArguments = $window.FindName('txtAppArguments')
|
||||
$script:uiState.Controls.txtAppSource = $window.FindName('txtAppSource')
|
||||
$script:uiState.Controls.btnAddApplication = $window.FindName('btnAddApplication')
|
||||
$script:uiState.Controls.btnSaveBYOApplications = $window.FindName('btnSaveBYOApplications')
|
||||
$script:uiState.Controls.btnLoadBYOApplications = $window.FindName('btnLoadBYOApplications')
|
||||
@@ -1962,7 +1966,7 @@ $window.Add_Loaded({
|
||||
})
|
||||
$script:uiState.Controls.txtModelFilter.Add_TextChanged({
|
||||
param($sourceObject, $textChangedEventArgs)
|
||||
Filter-DriverModels -filterText $script:uiState.Controls.txtModelFilter.Text
|
||||
Filter-DriverModels -filterText $script:uiState.Controls.txtModelFilter.Text -State $script:uiState
|
||||
})
|
||||
$script:uiState.Controls.btnDownloadSelectedDrivers.Add_Click({
|
||||
param($buttonSender, $clickEventArgs)
|
||||
@@ -1979,30 +1983,30 @@ $window.Add_Loaded({
|
||||
$script:uiState.Controls.txtStatus.Text = "Preparing driver downloads..."
|
||||
|
||||
# Define common necessary task-specific variables locally
|
||||
$localDriversFolder = $window.FindName('txtDriversFolder').Text
|
||||
$localWindowsRelease = $window.FindName('cmbWindowsRelease').SelectedItem.Value
|
||||
$localWindowsArch = $window.FindName('cmbWindowsArch').SelectedItem
|
||||
$localDriversFolder = $script:uiState.Controls.txtDriversFolder.Text
|
||||
$localWindowsRelease = $script:uiState.Controls.cmbWindowsRelease.SelectedItem.Value
|
||||
$localWindowsArch = $script:uiState.Controls.cmbWindowsArch.SelectedItem
|
||||
$localHeaders = $Headers # Use script-level variable
|
||||
$localUserAgent = $UserAgent # Use script-level variable
|
||||
$compressDrivers = $script:uiState.Controls.chkCompressDriversToWIM.IsChecked
|
||||
|
||||
# Define common necessary task-specific variables locally
|
||||
# Ensure required selections are made
|
||||
if ($null -eq $window.FindName('cmbWindowsRelease').SelectedItem) {
|
||||
if ($null -eq $script:uiState.Controls.cmbWindowsRelease.SelectedItem) {
|
||||
[System.Windows.MessageBox]::Show("Please select a Windows Release.", "Missing Information", "OK", "Warning")
|
||||
$buttonSender.IsEnabled = $true
|
||||
$script:uiState.Controls.pbOverallProgress.Visibility = 'Collapsed'
|
||||
$script:uiState.Controls.txtStatus.Text = "Driver download cancelled."
|
||||
return
|
||||
}
|
||||
if ($null -eq $window.FindName('cmbWindowsArch').SelectedItem) {
|
||||
if ($null -eq $script:uiState.Controls.cmbWindowsArch.SelectedItem) {
|
||||
[System.Windows.MessageBox]::Show("Please select a Windows Architecture.", "Missing Information", "OK", "Warning")
|
||||
$buttonSender.IsEnabled = $true
|
||||
$script:uiState.Controls.pbOverallProgress.Visibility = 'Collapsed'
|
||||
$script:uiState.Controls.txtStatus.Text = "Driver download cancelled."
|
||||
return
|
||||
}
|
||||
if (($selectedDrivers | Where-Object { $_.Make -eq 'HP' }) -and $null -eq $window.FindName('cmbWindowsVersion').SelectedItem) {
|
||||
if (($selectedDrivers | Where-Object { $_.Make -eq 'HP' }) -and $null -ne $script:uiState.Controls.cmbWindowsVersion -and $null -eq $script:uiState.Controls.cmbWindowsVersion.SelectedItem) {
|
||||
[System.Windows.MessageBox]::Show("HP drivers are selected. Please select a Windows Version.", "Missing Information", "OK", "Warning")
|
||||
$buttonSender.IsEnabled = $true
|
||||
$script:uiState.Controls.pbOverallProgress.Visibility = 'Collapsed'
|
||||
@@ -2010,10 +2014,10 @@ $window.Add_Loaded({
|
||||
return
|
||||
}
|
||||
|
||||
$localDriversFolder = $window.FindName('txtDriversFolder').Text
|
||||
$localWindowsRelease = $window.FindName('cmbWindowsRelease').SelectedItem.Value
|
||||
$localWindowsArch = $window.FindName('cmbWindowsArch').SelectedItem
|
||||
$localWindowsVersion = if ($null -ne $window.FindName('cmbWindowsVersion').SelectedItem) { $window.FindName('cmbWindowsVersion').SelectedItem } else { $null }
|
||||
$localDriversFolder = $script:uiState.Controls.txtDriversFolder.Text
|
||||
$localWindowsRelease = $script:uiState.Controls.cmbWindowsRelease.SelectedItem.Value
|
||||
$localWindowsArch = $script:uiState.Controls.cmbWindowsArch.SelectedItem
|
||||
$localWindowsVersion = if ($null -ne $script:uiState.Controls.cmbWindowsVersion -and $null -ne $script:uiState.Controls.cmbWindowsVersion.SelectedItem) { $script:uiState.Controls.cmbWindowsVersion.SelectedItem } else { $null }
|
||||
$localHeaders = $Headers # Use script-level variable
|
||||
$localUserAgent = $UserAgent # Use script-level variable
|
||||
$compressDrivers = $script:uiState.Controls.chkCompressDriversToWIM.IsChecked
|
||||
@@ -2133,8 +2137,8 @@ $window.Add_Loaded({
|
||||
$script:uiState.Controls.txtModelFilter.Text = ""
|
||||
$script:uiState.Controls.txtStatus.Text = "Driver list cleared."
|
||||
})
|
||||
$script:uiState.Controls.btnSaveDriversJson.Add_Click({ Save-DriversJson })
|
||||
$script:uiState.Controls.btnImportDriversJson.Add_Click({ Import-DriversJson })
|
||||
$script:uiState.Controls.btnSaveDriversJson.Add_Click({ Save-DriversJson -State $script:uiState })
|
||||
$script:uiState.Controls.btnImportDriversJson.Add_Click({ Import-DriversJson -State $script:uiState })
|
||||
|
||||
# Office interplay (Keep existing logic)
|
||||
$script:uiState.Flags.installAppsCheckedByOffice = $false
|
||||
@@ -2191,7 +2195,7 @@ $window.Add_Loaded({
|
||||
})
|
||||
|
||||
# Build dynamic multi-column checkboxes for optional features (Keep existing logic)
|
||||
if ($script:featuresPanel) { BuildFeaturesGrid -parent $script:featuresPanel -allowedFeatures $script:windowsSettingsDefaults.AllowedFeatures }
|
||||
if ($script:uiState.Controls.featuresPanel) { BuildFeaturesGrid -parent $script:uiState.Controls.featuresPanel -allowedFeatures $script:uiState.Defaults.windowsSettingsDefaults.AllowedFeatures }
|
||||
|
||||
# Updates/InstallApps interplay (Keep existing logic)
|
||||
$script:uiState.Flags.installAppsForcedByUpdates = $false
|
||||
@@ -2220,14 +2224,14 @@ $window.Add_Loaded({
|
||||
}
|
||||
}
|
||||
}
|
||||
$window.FindName('chkUpdateLatestDefender').Add_Checked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$window.FindName('chkUpdateLatestDefender').Add_Unchecked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$window.FindName('chkUpdateEdge').Add_Checked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$window.FindName('chkUpdateEdge').Add_Unchecked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$window.FindName('chkUpdateOneDrive').Add_Checked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$window.FindName('chkUpdateOneDrive').Add_Unchecked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$window.FindName('chkUpdateLatestMSRT').Add_Checked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$window.FindName('chkUpdateLatestMSRT').Add_Unchecked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$script:uiState.Controls.chkUpdateLatestDefender.Add_Checked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$script:uiState.Controls.chkUpdateLatestDefender.Add_Unchecked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$script:uiState.Controls.chkUpdateEdge.Add_Checked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$script:uiState.Controls.chkUpdateEdge.Add_Unchecked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$script:uiState.Controls.chkUpdateOneDrive.Add_Checked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$script:uiState.Controls.chkUpdateOneDrive.Add_Unchecked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$script:uiState.Controls.chkUpdateLatestMSRT.Add_Checked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
$script:uiState.Controls.chkUpdateLatestMSRT.Add_Unchecked({ & $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState })
|
||||
# Initial check for Updates/InstallApps state
|
||||
& $script:uiState.Controls.UpdateInstallAppsBasedOnUpdates -State $script:uiState
|
||||
|
||||
@@ -2338,23 +2342,23 @@ $window.Add_Loaded({
|
||||
})
|
||||
$script:uiState.Controls.btnBrowseApplicationPath.Add_Click({
|
||||
$selectedPath = Show-ModernFolderPicker -Title "Select Application Path Folder"
|
||||
if ($selectedPath) { $window.FindName('txtApplicationPath').Text = $selectedPath }
|
||||
if ($selectedPath) { $script:uiState.Controls.txtApplicationPath.Text = $selectedPath }
|
||||
})
|
||||
$script:uiState.Controls.btnBrowseAppListJsonPath.Add_Click({
|
||||
$ofd = New-Object System.Windows.Forms.OpenFileDialog
|
||||
$ofd.Filter = "JSON files (*.json)|*.json"
|
||||
$ofd.Title = "Select AppList.json File"
|
||||
$ofd.CheckFileExists = $false
|
||||
if ($ofd.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) { $window.FindName('txtAppListJsonPath').Text = $ofd.FileName }
|
||||
if ($ofd.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) { $script:uiState.Controls.txtAppListJsonPath.Text = $ofd.FileName }
|
||||
})
|
||||
$script:uiState.Controls.chkBringYourOwnApps.Add_Checked({ $script:uiState.Controls.byoApplicationPanel.Visibility = 'Visible' })
|
||||
$script:uiState.Controls.chkBringYourOwnApps.Add_Unchecked({
|
||||
$script:uiState.Controls.byoApplicationPanel.Visibility = 'Collapsed'
|
||||
# Clear fields when hiding
|
||||
$window.FindName('txtAppName').Text = ''
|
||||
$window.FindName('txtAppCommandLine').Text = ''
|
||||
$window.FindName('txtAppArguments').Text = ''
|
||||
$window.FindName('txtAppSource').Text = ''
|
||||
$script:uiState.Controls.txtAppName.Text = ''
|
||||
$script:uiState.Controls.txtAppCommandLine.Text = ''
|
||||
$script:uiState.Controls.txtAppArguments.Text = ''
|
||||
$script:uiState.Controls.txtAppSource.Text = ''
|
||||
})
|
||||
$script:uiState.Controls.chkInstallWingetApps.Add_Checked({ $script:uiState.Controls.wingetPanel.Visibility = 'Visible' })
|
||||
$script:uiState.Controls.chkInstallWingetApps.Add_Unchecked({
|
||||
@@ -2469,10 +2473,10 @@ $window.Add_Loaded({
|
||||
$script:uiState.Controls.txtStatus.Text = "Starting Winget app downloads..."
|
||||
|
||||
# Define necessary task-specific variables locally
|
||||
$localAppsPath = $window.FindName('txtApplicationPath').Text
|
||||
$localAppListJsonPath = $window.FindName('txtAppListJsonPath').Text
|
||||
$localWindowsArch = $window.FindName('cmbWindowsArch').SelectedItem
|
||||
$localOrchestrationPath = Join-Path -Path $window.FindName('txtApplicationPath').Text -ChildPath "Orchestration"
|
||||
$localAppsPath = $script:uiState.Controls.txtApplicationPath.Text
|
||||
$localAppListJsonPath = $script:uiState.Controls.txtAppListJsonPath.Text
|
||||
$localWindowsArch = $script:uiState.Controls.cmbWindowsArch.SelectedItem
|
||||
$localOrchestrationPath = Join-Path -Path $script:uiState.Controls.txtApplicationPath.Text -ChildPath "Orchestration"
|
||||
|
||||
# Create hashtable for task-specific arguments to pass to Invoke-ParallelProcessing
|
||||
$taskArguments = @{
|
||||
@@ -2506,29 +2510,29 @@ $window.Add_Loaded({
|
||||
# BYO Apps UI logic (Keep existing logic)
|
||||
$script:uiState.Controls.btnBrowseAppSource.Add_Click({
|
||||
$selectedPath = Show-ModernFolderPicker -Title "Select Application Source Folder"
|
||||
if ($selectedPath) { $window.FindName('txtAppSource').Text = $selectedPath }
|
||||
if ($selectedPath) { $script:uiState.Controls.txtAppSource.Text = $selectedPath }
|
||||
})
|
||||
$script:uiState.Controls.btnAddApplication.Add_Click({
|
||||
$name = $window.FindName('txtAppName').Text
|
||||
$commandLine = $window.FindName('txtAppCommandLine').Text
|
||||
$arguments = $window.FindName('txtAppArguments').Text
|
||||
$source = $window.FindName('txtAppSource').Text
|
||||
$name = $script:uiState.Controls.txtAppName.Text
|
||||
$commandLine = $script:uiState.Controls.txtAppCommandLine.Text
|
||||
$arguments = $script:uiState.Controls.txtAppArguments.Text
|
||||
$source = $script:uiState.Controls.txtAppSource.Text
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($name) -or [string]::IsNullOrWhiteSpace($commandLine) -or [string]::IsNullOrWhiteSpace($arguments)) {
|
||||
[System.Windows.MessageBox]::Show("Please fill in all fields (Name, Command Line, and Arguments)", "Missing Information", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||
return
|
||||
}
|
||||
$listView = $window.FindName('lstApplications')
|
||||
$listView = $script:uiState.Controls.lstApplications
|
||||
$priority = 1
|
||||
if ($listView.Items.Count -gt 0) {
|
||||
$priority = ($listView.Items | Measure-Object -Property Priority -Maximum).Maximum + 1
|
||||
}
|
||||
$application = [PSCustomObject]@{ Priority = $priority; Name = $name; CommandLine = $commandLine; Arguments = $arguments; Source = $source; CopyStatus = "" }
|
||||
$listView.Items.Add($application)
|
||||
$window.FindName('txtAppName').Text = ""
|
||||
$window.FindName('txtAppCommandLine').Text = ""
|
||||
$window.FindName('txtAppArguments').Text = ""
|
||||
$window.FindName('txtAppSource').Text = ""
|
||||
$script:uiState.Controls.txtAppName.Text = ""
|
||||
$script:uiState.Controls.txtAppCommandLine.Text = ""
|
||||
$script:uiState.Controls.txtAppArguments.Text = ""
|
||||
$script:uiState.Controls.txtAppSource.Text = ""
|
||||
Update-CopyButtonState -State $script:uiState
|
||||
})
|
||||
$script:uiState.Controls.btnSaveBYOApplications.Add_Click({
|
||||
@@ -2536,24 +2540,24 @@ $window.Add_Loaded({
|
||||
$saveDialog.Filter = "JSON files (*.json)|*.json|All files (*.*)|*.*"
|
||||
$saveDialog.DefaultExt = ".json"
|
||||
$saveDialog.Title = "Save Application List"
|
||||
$initialDir = $window.FindName('txtApplicationPath').Text
|
||||
$initialDir = $script:uiState.Controls.txtApplicationPath.Text
|
||||
if ([string]::IsNullOrWhiteSpace($initialDir) -or -not (Test-Path $initialDir)) { $initialDir = $PSScriptRoot }
|
||||
$saveDialog.InitialDirectory = $initialDir
|
||||
$saveDialog.FileName = "UserAppList.json"
|
||||
if ($saveDialog.ShowDialog()) { Save-BYOApplicationList -Path $saveDialog.FileName }
|
||||
if ($saveDialog.ShowDialog()) { Save-BYOApplicationList -Path $saveDialog.FileName -State $script:uiState }
|
||||
})
|
||||
$script:uiState.Controls.btnLoadBYOApplications.Add_Click({
|
||||
$openDialog = New-Object Microsoft.Win32.OpenFileDialog
|
||||
$openDialog.Filter = "JSON files (*.json)|*.json|All files (*.*)|*.*"
|
||||
$openDialog.Title = "Import Application List"
|
||||
$initialDir = $window.FindName('txtApplicationPath').Text
|
||||
$initialDir = $script:uiState.Controls.txtApplicationPath.Text
|
||||
if ([string]::IsNullOrWhiteSpace($initialDir) -or -not (Test-Path $initialDir)) { $initialDir = $PSScriptRoot }
|
||||
$openDialog.InitialDirectory = $initialDir
|
||||
if ($openDialog.ShowDialog()) { Import-BYOApplicationList -Path $openDialog.FileName -State $script:uiState; Update-CopyButtonState -State $script:uiState }
|
||||
})
|
||||
$script:uiState.Controls.btnClearBYOApplications.Add_Click({
|
||||
$result = [System.Windows.MessageBox]::Show("Are you sure you want to clear all applications?", "Clear Applications", [System.Windows.MessageBoxButton]::YesNo, [System.Windows.MessageBoxImage]::Question)
|
||||
if ($result -eq [System.Windows.MessageBoxResult]::Yes) { $window.FindName('lstApplications').Items.Clear(); Update-CopyButtonState -State $script:uiState }
|
||||
if ($result -eq [System.Windows.MessageBoxResult]::Yes) { $script:uiState.Controls.lstApplications.Items.Clear(); Update-CopyButtonState -State $script:uiState }
|
||||
})
|
||||
$script:uiState.Controls.btnCopyBYOApps.Add_Click({
|
||||
param($buttonSender, $clickEventArgs)
|
||||
@@ -2570,7 +2574,7 @@ $window.Add_Loaded({
|
||||
$script:uiState.Controls.txtStatus.Text = "Starting BYO app copy..."
|
||||
|
||||
# Define necessary task-specific variables locally
|
||||
$localAppsPath = $window.FindName('txtApplicationPath').Text
|
||||
$localAppsPath = $script:uiState.Controls.txtApplicationPath.Text
|
||||
|
||||
# Create hashtable for task-specific arguments
|
||||
$taskArguments = @{
|
||||
@@ -2620,23 +2624,23 @@ $window.Add_Loaded({
|
||||
# General Browse Button Handlers (Keep existing logic)
|
||||
$script:uiState.Controls.btnBrowseFFUDevPath.Add_Click({
|
||||
$selectedPath = Show-ModernFolderPicker -Title "Select FFU Development Path"
|
||||
if ($selectedPath) { $window.FindName('txtFFUDevPath').Text = $selectedPath }
|
||||
if ($selectedPath) { $script:uiState.Controls.txtFFUDevPath.Text = $selectedPath }
|
||||
})
|
||||
$script:uiState.Controls.btnBrowseFFUCaptureLocation.Add_Click({
|
||||
$selectedPath = Show-ModernFolderPicker -Title "Select FFU Capture Location"
|
||||
if ($selectedPath) { $window.FindName('txtFFUCaptureLocation').Text = $selectedPath }
|
||||
if ($selectedPath) { $script:uiState.Controls.txtFFUCaptureLocation.Text = $selectedPath }
|
||||
})
|
||||
$script:uiState.Controls.btnBrowseOfficePath.Add_Click({
|
||||
$selectedPath = Show-ModernFolderPicker -Title "Select Office Path"
|
||||
if ($selectedPath) { $window.FindName('txtOfficePath').Text = $selectedPath }
|
||||
if ($selectedPath) { $script:uiState.Controls.txtOfficePath.Text = $selectedPath }
|
||||
})
|
||||
$script:uiState.Controls.btnBrowseDriversFolder.Add_Click({
|
||||
$selectedPath = Show-ModernFolderPicker -Title "Select Drivers Folder"
|
||||
if ($selectedPath) { $window.FindName('txtDriversFolder').Text = $selectedPath }
|
||||
if ($selectedPath) { $script:uiState.Controls.txtDriversFolder.Text = $selectedPath }
|
||||
})
|
||||
$script:uiState.Controls.btnBrowsePEDriversFolder.Add_Click({
|
||||
$selectedPath = Show-ModernFolderPicker -Title "Select PE Drivers Folder"
|
||||
if ($selectedPath) { $window.FindName('txtPEDriversFolder').Text = $selectedPath }
|
||||
if ($selectedPath) { $script:uiState.Controls.txtPEDriversFolder.Text = $selectedPath }
|
||||
})
|
||||
$script:uiState.Controls.btnBrowseDriversJsonPath.Add_Click({
|
||||
$sfd = New-Object System.Windows.Forms.SaveFileDialog
|
||||
@@ -3003,7 +3007,7 @@ function Import-BYOApplicationList {
|
||||
|
||||
try {
|
||||
$applications = Get-Content -Path $Path -Raw | ConvertFrom-Json
|
||||
$listView = $window.FindName('lstApplications')
|
||||
$listView = $State.Controls.lstApplications
|
||||
$listView.Items.Clear()
|
||||
|
||||
# Add items and sort by priority from the file
|
||||
@@ -3037,8 +3041,8 @@ function Import-BYOApplicationList {
|
||||
$btnRun = $window.FindName('btnRun')
|
||||
$btnRun.Add_Click({
|
||||
try {
|
||||
$progressBar = $window.FindName('progressBar')
|
||||
$txtStatus = $window.FindName('txtStatus')
|
||||
$progressBar = $script:uiState.Controls.pbOverallProgress
|
||||
$txtStatus = $script:uiState.Controls.txtStatus
|
||||
$progressBar.Visibility = 'Visible'
|
||||
$txtStatus.Text = "Starting FFU build..."
|
||||
$config = Get-UIConfig -State $script:uiState
|
||||
@@ -3054,10 +3058,10 @@ $btnRun.Add_Click({
|
||||
}
|
||||
catch {
|
||||
[System.Windows.MessageBox]::Show("An error occurred: $_", "Error", "OK", "Error")
|
||||
$window.FindName('txtStatus').Text = "FFU build failed."
|
||||
$script:uiState.Controls.txtStatus.Text = "FFU build failed."
|
||||
}
|
||||
finally {
|
||||
$window.FindName('progressBar').Visibility = 'Collapsed'
|
||||
$script:uiState.Controls.pbOverallProgress.Visibility = 'Collapsed'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3361,7 +3365,7 @@ $btnLoadConfig.Add_Click({
|
||||
|
||||
if ($shouldAutoCheckSpecificDrives) {
|
||||
WriteLog "LoadConfig: Auto-checking 'Select Specific USB Drives' due to pre-selected USB drives in config."
|
||||
$window.FindName('chkSelectSpecificUSBDrives').IsChecked = $true
|
||||
$script:uiState.Controls.chkSelectSpecificUSBDrives.IsChecked = $true
|
||||
}
|
||||
else {
|
||||
WriteLog "LoadConfig: Condition to auto-check 'Select Specific USB Drives' was NOT met."
|
||||
|
||||
Reference in New Issue
Block a user