Commit Graph

72 Commits

Author SHA1 Message Date
rbalsleyMSFT 61ec7509ad Refactor: Move model fetching logic to core UI module
Centralizes the `btnGetModels` click event handler from the main UI script into the `FFUUI.Core` module to improve code organization and separation of concerns.

The handler is updated to use the local state object instead of a global script variable. The logic for updating the model list is also improved to preserve the collection's object reference, ensuring data binding stability.
2025-06-17 15:07:18 -07:00
rbalsleyMSFT 0bcedadc5c Refactors UI event handlers into core module
Moves UI event handler registration logic from the main script to the `Register-EventHandlers` function in the `FFUUI.Core` module.

This change centralizes UI logic, improving code organization and modularity. The event handlers are also updated to access state via the window's tag, reducing reliance on script-scoped variables.
2025-06-17 15:03:12 -07:00
rbalsleyMSFT c1c5aa9239 Refactor: Move initial Windows settings population to core module
Moves the logic for the initial population of the Windows settings comboboxes from the UI's loaded event handler into the `Initialize-UIDefaults` function.

This change centralizes UI default value setup into a single location, improving code organization and maintainability.
2025-06-17 14:26:31 -07:00
rbalsleyMSFT ab7c8aa250 Refactor UI initialization and event handling
Moves the VM Switch data population and event handler logic from the main UI script into the `FFUUI.Core.Initialize` module.

This change improves code organization by centralizing UI initialization and event registration into dedicated functions, making the main script cleaner.

It also simplifies module manifests by changing explicit function exports to a wildcard.
2025-06-17 14:18:41 -07:00
rbalsleyMSFT 0fb9878cff Refactor Windows settings function for clarity
Renames the function for populating Windows settings UI controls to better reflect its purpose.

The `Get-` verb more accurately describes the function's action of retrieving information from the ISO file, as opposed to the previous `Initialize-` verb.
2025-06-17 13:21:56 -07:00
rbalsleyMSFT acd0092f26 Refactor UI initialization into core module
Extracts the logic for setting default UI control values from the main script into a new `Initialize-UIDefaults` function within the `FFUUI.Core` module.

This change cleans up the main UI script's window loaded event, improving code organization and separating UI setup from default value initialization.
2025-06-17 13:14:54 -07:00
rbalsleyMSFT 71a4923c56 Refactors UI control access for improved clarity
Replaces `$window.FindName` with  `$script:uiState.Controls` for accessing UI elements.

This change simplifies how UI controls are referenced, making the code easier to read and maintain.
2025-06-17 10:38:14 -07:00
rbalsleyMSFT f1d0ab20cb Refactor function names and improve code formatting
Renames functions for better semantic clarity:
- `Refresh-WindowsSettingsCombos` becomes `Initialize-WindowsSettingsCombos` to better reflect its role in initial UI setup.
- `Filter-DriverModels` becomes `Search-DriverModels` to more accurately describe its use in user-driven model searches.

Enhances code readability in the UI script through consistent formatting of event handlers and multi-line script blocks.
2025-06-16 19:37:58 -07:00
rbalsleyMSFT fb9dc3fbc5 Refactors dynamic UI setup into core module for better organization
Moves initialization logic for several list views (driver models, Winget results, app script variables) and the features grid into a new `Initialize-DynamicUIElements` function.
This centralizes the setup of these UI components within the `FFUUI.Core.Initialize` module, improving code structure.

Additionally:
- Updates sort event handlers in the new module to correctly retrieve UI state from the window's tag.
- Enhances `Invoke-ListViewSort` by initializing sort state flags if they are not already present, improving sorting stability.
2025-06-16 18:28:04 -07:00
rbalsleyMSFT 026fdc0d33 Removes redundant comment from appsScriptVariablesDataList clearing logic 2025-06-15 14:22:13 -07:00
rbalsleyMSFT 08a4c1b732 Removes comments from driver UI logic
Cleans up the driver selection UI script by removing comments that were redundant, self-explanatory, or no longer relevant.
This enhances code readability and maintainability without altering functionality.
2025-06-15 13:58:27 -07:00
rbalsleyMSFT 4b4f5eba8c Refactors UI configuration and state management
Moves UI configuration loading and retrieval logic into a new `FFUUI.Core.Config` module.
Removes the `Set-UIValue` helper function from `BuildFFUVM_UI.ps1` and the `Get-UIConfig` function from `FFUUI.Core.psm1`.
This centralizes UI-related configuration handling for improved modularity.
2025-06-13 13:43:43 -07:00
rbalsleyMSFT 8c9d40eefa Refactor: Relocate Windows settings logic to new module
Moves functions and static data related to Windows releases, versions, SKUs, and optional features from the main UI script and core module into a new, dedicated `FFUUI.Core.WindowsSettings` module.

This change enhances code organization and modularity by centralizing Windows-specific configuration and UI helper functions. The UI script is updated to reflect these changes, including passing state to the refactored `BuildFeaturesGrid` function.
2025-06-13 13:22:43 -07:00
rbalsleyMSFT 6b0fb0385d Removes obsolete path variable definitions
Cleans up script initialization by removing unused path variables for application, application list, and user application list.
2025-06-13 11:55:32 -07:00
rbalsleyMSFT 2e9a7265e9 Refactors application management to a new module
Moves ListView manipulation, BYO application import/export, and copy task logic from the main UI script and core UI module into a new `FFUUI.Core.Applications` module.

This improves code organization and modularity for application-related features.
2025-06-13 11:53:14 -07:00
rbalsleyMSFT d1835c5c06 Refactor Winget functions into a dedicated module
Extracts Winget-related functionalities, including search, list management, installation, and download tasks, from `BuildFFUVM_UI.ps1` and `FFUUI.Core.psm1`.
Consolidates these features into a new module, `FFUUI.Core.Winget.psm1`, to improve code organization and maintainability.
2025-06-13 10:34:46 -07:00
rbalsleyMSFT 7babad8262 Refactor driver management into dedicated modules
Relocates driver-specific download, parsing, and management logic from the main UI script and the FFUUI.Core module into new, dedicated modules for each manufacturer (Dell, HP, Lenovo, Microsoft). This improves modularity and code organization.

Additionally, centralizes common HTTP headers and user agent strings in the FFUUI.Core module, accessible via a new helper function.
2025-06-12 15:47:46 -07:00
rbalsleyMSFT 9282b4231e Add FFU.Common and FFUUI.Core module manifests and shared UI functions
- Created module manifest for FFU.Common with initial version 0.0.1.
- Created module manifest for FFUUI.Core with initial version 0.0.1.
- Implemented shared UI functions in FFUUI.Shared.psm1, including:
  - Update-ListViewItemStatus: Updates the status of items in a ListView.
  - Update-OverallProgress: Updates a progress bar and status label.
  - Invoke-ProgressUpdate: Enqueues progress updates to the UI thread.
  - Add-SortableColumn: Adds sortable columns to a ListView.
  - Add-SelectableGridViewColumn: Adds a selectable column with a "Select All" checkbox.
  - Update-SelectAllHeaderCheckBoxState: Updates the state of the header checkbox.
  - Invoke-ListViewSort: Sorts ListView items based on specified properties.
  - Show-ModernFolderPicker: Displays a modern folder picker dialog.
2025-06-11 20:50:51 -07:00
rbalsleyMSFT e4201aebff Refactor UI initialization to utilize centralized state object for control management
- Introduced the Initialize-UIControls function to streamline the assignment of UI control references to the centralized state object.
- Removed repetitive control assignments from the window loading event, enhancing maintainability and readability.
- Improved the overall structure of the UI initialization process for better consistency across the application.
2025-06-10 20:09:13 -07:00
rbalsleyMSFT 1fb42bffdc Implement code changes to enhance functionality and improve performance 2025-06-10 19:04:25 -07:00
rbalsleyMSFT 9d7d0a0ec9 Remove debug logging statements from UI initialization for cleaner code 2025-06-09 20:32:54 -07:00
rbalsleyMSFT c5730230f6 Refactor functions to utilize a centralized state object for improved consistency and maintainability
Refactor functions to use a centralized state object

Modifies various functions to accept and utilize a `$State` parameter, replacing direct access to `$script:uiState` and module-scoped variables.

This change centralizes state management, improving code consistency and maintainability by passing necessary UI elements, data, and default configurations explicitly.
2025-06-09 20:30:57 -07:00
rbalsleyMSFT 19867cbcd9 Remove verbose flag from BuildFFUVM script execution for cleaner output 2025-06-07 20:21:44 -07:00
rbalsleyMSFT 131bd63a5b Refactor MainThreadLogPath to use script:uiState.LogFilePath for consistency 2025-06-07 19:07:05 -07:00
rbalsleyMSFT 562529a26b Refactor Get-ModelsForMake and Update-CopyButtonState to use State parameter
- Updated functions to accept a State parameter for improved scope management.
- Replaced direct window control access with State object references for better encapsulation and consistency.
- Ensured proper handling of UI elements within the context of the State object.

Refactors UI functions to use a State parameter

Improves scope management and encapsulation by passing a `State` object to UI-interacting functions.

This change modifies several functions, including `Get-ModelsForMake` and `Update-CopyButtonState`, to accept a `State` parameter.
It replaces direct access to UI controls via `$window.FindName` with references from the `State` object, leading to more consistent and maintainable code.
2025-06-07 18:47:15 -07:00
rbalsleyMSFT 6eae7226be Refactor UpdateInstallApps logic to use state object
- Moved the UpdateInstallAppsBasedOnUpdates function to the Controls section of the uiState object for better encapsulation.
- Updated the function to accept a state parameter, reducing reliance on the script scope.
- Adjusted event handlers to pass the state object, ensuring consistent access to UI state.
- Removed the previous definition of the function from the script scope to streamline the code.
2025-06-07 18:12:12 -07:00
rbalsleyMSFT 0091a4da92 Docs: Correct comment for Windows SKU combo population
The comment explaining how the Windows SKU combo box's ItemsSource is populated was outdated. It incorrectly stated that the `Update-WindowsSkuCombo` function was called via `RefreshWindowsSettingsCombos`.

This change removes the inaccurate reference, clarifying that `Update-WindowsSkuCombo` is now called directly.
2025-06-07 17:57:24 -07:00
rbalsleyMSFT 11084f6689 Added new $state object and refactored code to use the $state reference instead.
- Moved Get-UIConfig from BuildFFUVM_UI.ps1 to FFUUI.Core.psm1 to enhance separation of concerns.
- Updated Get-UIConfig to accept a central $State object, removing direct dependencies on global UI variables.
- Modified internal logic to access UI control values from the $State.Controls hashtable.
- Updated calls in BuildFFUVM_UI.ps1 to pass the $script:uiState object to the refactored function.
- Exported Get-UIConfig from FFUUI.Core.psm1 for accessibility in the main UI script.
2025-06-07 17:36:30 -07:00
rbalsleyMSFT 1b5fa5129c Updated formatting 2025-06-05 16:31:44 -07:00
rbalsleyMSFT 4ffdba8e41 Refactor Windows SKU handling to derive values internally and update mappings for LTSB/LTSC releases
- Updated Update-WindowsSkuCombo function to derive selected release value and display name from the ComboBox, removing the need for parameters.
- Enhanced logging to include display names for better traceability.
- Corrected SKU values for Windows 10 LTSB 2016 and LTSC 2019 in the release mappings.
- Adjusted Get-AvailableSkusForRelease function to handle specific cases for LTSB 2016 and LTSC 2019, ensuring accurate SKU retrieval.
2025-05-29 17:19:22 -07:00
rbalsleyMSFT 092ae26257 Add dynamic SKU handling for Windows releases and update UI integration
- Introduced a new function `Get-AvailableSkusForRelease` to retrieve available SKUs based on the selected Windows release value.
- Added a new function `Update-WindowsSkuCombo` to refresh the SKU ComboBox in the UI when the release changes.
- Updated the SKU lists for various Windows versions, including client and server SKUs, as well as LTSC editions.
- Modified the `RefreshWindowsSettingsCombos` function to call the new SKU update function.
- Ensured that the SKU ComboBox is populated dynamically based on the selected release, improving user experience and accuracy.
2025-05-29 16:59:45 -07:00
rbalsleyMSFT fd3d45a21a Improve initial directory handling for Drivers.json SaveFileDialog
- Enhanced logic to determine the initial directory for the SaveFileDialog based on the parent directory of the path in the txtDriversJsonPath TextBox.
- Added error handling and logging for cases where the path is invalid or empty, ensuring the dialog defaults to its standard behavior when necessary.
- Improved user feedback by logging actions related to the selection or cancellation of the SaveFileDialog.
2025-05-29 14:02:40 -07:00
rbalsleyMSFT c8042c6a75 Add Drivers.json path configuration to UI and core logic
- Introduced a new TextBox and Button in the UI for specifying the Drivers.json file path.
- Updated the UI layout to accommodate the new Drivers.json path input.
- Enhanced the core logic to set a default path for Drivers.json based on the Drivers folder.
- Implemented functionality to browse and select the Drivers.json file, allowing users to create or select an existing file.
2025-05-29 13:26:03 -07:00
rbalsleyMSFT 421fb76320 Add 'Update Latest Microcode' checkbox to UI and update related logic for handling microcode updates 2025-05-29 12:54:15 -07:00
rbalsleyMSFT 6f336970db Add 'Update ADK' checkbox to UI and update related logic for handling ADK installation 2025-05-29 10:39:19 -07:00
rbalsleyMSFT 985285963c Add 'Remove Downloaded Update Files' checkbox to UI and update related logic for handling updates 2025-05-28 18:01:59 -07:00
rbalsleyMSFT 43223ad1cc Add 'Remove Apps Folder Content' checkbox to UI and update related logic
- Introduced a new checkbox in the UI for removing application content in the Apps folder after FFU capture.
- Updated the Get-UIConfig function to retrieve the state of the new checkbox.
- Added default value for the new 'RemoveApps' parameter in the general defaults.
2025-05-28 17:43:59 -07:00
rbalsleyMSFT f6c8172676 Implement Apps Script Variables data list and enhance ListView sorting functionality
- Introduced a script-scoped list for managing Apps Script Variables data.
- Updated the ListView to bind its ItemsSource to the new data list.
- Enabled sorting for Key and Value columns in the Apps Script Variables ListView.
- Improved item addition and removal logic to interact with the data list directly.
- Ensured header checkbox state updates correctly after modifications to the data list.
2025-05-28 16:50:45 -07:00
rbalsleyMSFT 05466f96c0 Add selectable "Select All" checkbox functionality to ListView columns and update button naming for clarity
- Implemented Add-SelectableGridViewColumn function to allow adding a header checkbox for selecting all items in ListViews.
- Updated the ListView setup in BuildFFUVM_UI.ps1 to utilize the new selectable column feature for driver models and winget results.
- Added IsSelected property to items in Apps Script Variables ListView for better selection management.
- Renamed button from "Remove Apps Script Variable" to "Remove Selected" for improved clarity on functionality.
2025-05-28 15:33:24 -07:00
rbalsleyMSFT 3ec53548a9 Add AppsScriptVariables functionality to UI for defining key-value pairs
- Introduced a new checkbox to enable defining Apps Script Variables.
- Added a panel for inputting key-value pairs with validation for duplicates.
- Implemented event handlers for adding, removing, and clearing Apps Script Variables.
- Updated LoadConfig logic to handle loading of Apps Script Variables from configuration.
2025-05-27 19:12:48 -07:00
rbalsleyMSFT bde3cdd09f Update LoadConfig logic to manage Optional Features checkboxes based on loaded configuration. Added functionality to check/uncheck feature checkboxes according to the loaded features string, enhancing user interface responsiveness and clarity. 2025-05-26 18:12:32 -07:00
rbalsleyMSFT d05f9aa267 Enhance USB drive selection logic in LoadConfig process
- Added functionality to automatically check "Select Specific USB Drives" if USBDriveList is present and not empty in the configuration.
- Implemented checks for both PSCustomObject and hashtable types for backward compatibility.
- Included logging for the auto-check condition to improve traceability during configuration loading.
2025-05-26 17:59:28 -07:00
rbalsleyMSFT d253a88daa Add Set-UIValue function for improved UI property handling and configuration loading
- Introduced a new helper function `Set-UIValue` to streamline the process of setting UI properties from configuration objects, enhancing error handling and logging.
- Updated the `Get-UIConfig` function to utilize `Set-UIValue` for loading various UI elements from the configuration file, improving code readability and maintainability.
- Enhanced logic for handling driver model selection based on user input and added robust checks for configuration keys.
- Improved logging for configuration loading process, including error handling for missing keys and exceptions.
2025-05-26 17:08:08 -07:00
rbalsleyMSFT 6db5a93598 Refactor Get-UIConfig function to enhance parameter handling and improve clarity. Added new parameters from Sample_default.json, renamed existing parameters for consistency, and removed unnecessary comments. Updated logic to derive paths for UserAppList.json and Orchestration based on user input. 2025-05-26 15:35:32 -07:00
rbalsleyMSFT 550e45a5c0 Updated UI Config parameters 2025-05-26 13:04:49 -07:00
rbalsleyMSFT f162de89be - Added Apps\Orchestration folder with new orchestration workflow to replace InstallAppsAndSysprep.cmd file.
- Updated BuildFFUUnattend files to point to the new Orchestrator.ps1 file.
- Added new common and FFUUI.Core directories that house common/shared files between the UI and PS1 script. This breaks up each of the PS1 scripts to keep things smaller and more organized. Still a lot of work to do here to pull some stuff out of the PS1 scripts.
- Modified the CaptureFFU.ps1 file to include more info during the capture process to help with troubleshooting
- Too many functional changes to list here.
2025-05-26 11:54:14 -07:00
rbalsleyMSFT 2efb9fb2a1 Added common winget functions 2025-05-26 11:40:06 -07:00
rbalsleyMSFT 1156373f0c Add Save, Load, and Clear functionality for BYO applications with JSON support 2025-05-26 11:40:06 -07:00
rbalsleyMSFT 5f9bf37617 Add functionality to manage applications - implement Add and Remove buttons with priority handling in the UI 2025-05-26 11:40:06 -07:00
rbalsleyMSFT c0fdd102e3 Add application information section for 'Bring Your Own Applications' feature - added code for modern folder browser and added the code behind for the browse folder buttons 2025-05-26 11:40:06 -07:00