Implements a deferred cleanup mechanism for driver source folders when they are compressed to a WIM and also used for WinPE.
When drivers are compressed, the original source folders are now preserved if they are also needed for WinPE driver injection. A marker file is created in these preserved folders.
A new cleanup step is added after the WinPE media creation to remove these preserved folders, ensuring they are available when needed but not left behind permanently.
Enhances the model name normalization function to better handle variations in hardware model strings. This change introduces specific rules to canonicalize "All-in-One" and screen size variants (e.g., "-in" or "inch") for more reliable matching against driver mapping rules.
Additionally, optimizes performance by normalizing the system model once before the comparison loop. Logging is also added to show the original and normalized model strings for easier debugging.
Introduces a new feature, `UseDriversAsPEDrivers`, that allows WinPE drivers to be sourced directly from the main driver repository.
When enabled, the script scans all available drivers, parses their INF files, and copies only the essential driver types (e.g., storage, mouse, keyboard, touchpad, system devices) needed for WinPE. This eliminates the need to maintain a separate, manually curated `PEDrivers` folder.
The UI is updated with a new checkbox that becomes visible when "Copy PE Drivers" is selected, making this a sub-option. Parameter validation is also adjusted to support this new workflow.
Introduces a "Restore Defaults" feature in the UI to reset the environment. This action removes generated configuration files, ISOs, downloaded apps, updates, drivers, and FFUs.
The post-build cleanup logic is refactored from the main build script into a new common function. This new function is used by both the standard build process and the new restore defaults feature, promoting code reuse and simplifying maintenance.
Updates the visibility of UI panels for Winget and drivers when a previous environment is automatically loaded.
This ensures that if Winget apps or driver models are present, their corresponding UI sections are made visible. Additionally, it updates the "select all" checkbox state for Winget results and attempts to pre-select the hardware make for loaded drivers.
Implements a new feature to automatically load the previously saved environment when the UI is launched.
This improves user experience by restoring the last saved configuration, including selected applications and drivers, eliminating the need to manually reload them on each run.
The process loads the main `FFUConfig.json` and then proceeds to load associated Winget, BYO App, and Driver lists if they are defined. UI elements and checkboxes are updated accordingly to reflect the loaded state.
- Changed the default disk size parameter from 30GB to 50GB in BuildFFUVM.ps1 and FFUUI.Core.psm1 to accommodate larger virtual machines.
- Updated tooltip and default value in the UI XAML file to reflect the new disk size.
Comments out the logic that forces app installation when building from a downloaded ESD file. This workaround was implemented to prevent an OOBE reboot loop but is no longer required. This should speed up scenarios where you want to download the ESD media, install the latest CU and .NET CU, and capture the FFU.
Renames `Remove-DisabledUpdates` to `Remove-DisabledArtifacts` to better reflect its expanded scope.
This function now also removes Office installation scripts and downloaded content if the Office installation is disabled via the `$InstallOffice` flag.
The function call is moved to run before app installations to ensure artifacts are removed prior to the installation phase.
Introduces a new function to remove residual artifacts for updates that are disabled via script flags.
If updates for Defender, MSRT, OneDrive, or Edge are turned off, this change ensures that any related files are deleted from the build environment. This prevents unnecessary files from being included in the final image.
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.
Refines the post-download cleanup process for applications with multiple installers.
When multiple installers are downloaded for an application, this change introduces logic to select the most appropriate one based on the target Windows architecture. It prioritizes universal installers first, then architecture-specific installers, before falling back to the previous method of selecting the newest file by signature date.
This ensures a more accurate installer is chosen, especially when Winget provides multiple architecture options for a single package.
Improves the reliability of WinGet app processing by making several key changes.
The build process now deletes the `WinGetWin32Apps.json` file before each run to ensure it is always freshly generated.
The UI no longer relies on `WinGetWin32Apps.json` to detect previously downloaded content. Instead, it checks directly for the application's content on disk, preventing unnecessary re-downloads.
This change also introduces a feature allowing users to override the default silent install commands for Win32 apps. By specifying `CommandLine` or `Arguments` properties in `AppList.json`, these values will be used to update the corresponding entries in `WinGetWin32Apps.json` during the build process.
Eliminates the read-only field and derives the features list directly from the checked items, producing a sorted semicolon string when collecting config. Avoids duplicated state, prevents desynchronization between UI elements, and yields deterministic ordering for persistence.
- Added logic to check for per-user Appx packages that are not provisioned for all users, which could block the Sysprep process.
- Introduced a hash set to store provisioned package families and collect current user Appx packages while excluding frameworks and non-removable packages.
- Implemented removal of non-provisioned Appx packages with error handling and re-checking to ensure all blockers are resolved before proceeding with Sysprep.
- Creates a new parameter [bool]InjectUnattend
- This will take the FFUDevelopment\Unattend\unattend_[arch].xml file and copy it to the FFUDevelopment\Apps\Unattend and rename the file to unattend.xml.
- This is useful for situations where you don't use the USB drive for deploying the FFU but still have Unattend-related customizations that you want to apply.
- Improved detection of installer candidates by reading YAML configuration for NestedInstallerFiles.
- Added logic to resolve silent install switches from YAML, prioritizing block-level settings.
- Enhanced fallback mechanisms for selecting installers when multiple candidates are found.
- Updated command construction to accommodate new installer resolution logic.
- Implemented Select-VMSwitchFromConfig function to handle VM switch selection based on configuration.
- Enhanced Register-EventHandlers to persist custom VM switch name and IP address when 'Other' is selected.
- Improved user experience by ensuring relevant fields are populated correctly based on user input and configuration settings.
Adds in‑progress markers around OEM driver downloads to enable recovery and reliable post‑run cleanup.
Refactors driver cleanup to be run‑aware: maps download targets to model folders, removes temp/model content created during the run, prunes empties, and preserves existing make roots via creation‑time checks.
Includes the Drivers folder in current‑run cleanup with safer rules to avoid deleting pre‑existing content.
Improves Office process termination by resolving the Office path (prefers UI value) and only acting when a valid folder exists.
- Introduced flags to track if a build is in progress and if cleanup is running.
- Enhanced the button click handler to allow users to cancel an ongoing build and initiate a cleanup process.
- Implemented a mechanism to stop background jobs and terminate associated processes during cancellation.
- Added logic to manage log file reading during cleanup and ensure proper UI updates.
- Updated the state management to reflect the current operation status accurately.
- Introduced a new parameter `MaxUSBDrives` to control the maximum number of USB drives that can be built in parallel, with a default value of 5.
- Updated UI to include a textbox for setting `MaxUSBDrives`.
- Implemented validation to ensure the value is a non-negative integer.
- Adjusted the deployment function to respect the `MaxUSBDrives` limit during USB drive creation.
- Moved unattend file injection logic to occur after VHDX caching to ensure the cached VHDX does not contain audit-mode unattend.
- Simplified the logic to determine if the VHDX is already mounted, reducing redundant mount/dismount cycles.
- Ensured the unattend file is copied to the correct directory based on the Windows architecture.
Improves JSON parsing of the driver mapping file to handle different file structures more reliably.
Adds logging to show all potential driver mapping rules that match the current system, making it easier to diagnose rule selection.
Updates the logging messages to more accurately reflect that the computer name change takes effect after a restart. The `Set-Computername` command stages the change, so the log now indicates the name "will be set" instead of "was set".
Moves the 'Device Name Selection' section header out of the conditional blocks to a common location. This refactoring avoids code repetition and improves maintainability.
Applies a workaround for an issue where the `Microsoft.PowerShell.LocalAccounts` module fails to load in PowerShell 7 on Windows 11 23H2 and earlier.
The script now checks the OS build number and imports the module using the Windows PowerShell compatibility layer on affected systems.
Fixes: https://github.com/PowerShell/PowerShell/issues/21645
Introduces multi-selection capabilities to the "Bring Your Own" applications list, allowing users to select and remove multiple applications at once.
This change also adds the ability to edit an existing application's details directly from the UI. The application list view is now dynamically generated to support these new features, including selectable rows.
Key changes:
- Adds "Edit Application" and "Remove Selected" buttons.
- Enables/disables action buttons based on the number of selected items.
- Modifies the "Add Application" form to function as an "Update" form when editing.
- Implements selection via mouse click, checkboxes, and the spacebar.
This ensures the main application installation feature remains active when any of its dependent options are chosen, creating a more consistent user experience.
Updates UI logic to automatically select the main 'Install Apps' option whenever the 'Bring Your Own Apps' option is selected.
This ensures the parent category is always active when a user opts to bring their own applications, preventing an inconsistent UI state. The logic is applied both when updating panel visibility and when restoring checkbox states.
Introduces a new feature allowing application installations to succeed regardless of their exit code. This is useful for installers that may return non-standard exit codes which should be treated as successful.
Changes include:
- A new checkbox in the UI to enable this option for an application.
- Updates to the application installation script to handle the new setting.
- Modifications to save and load this setting in the application list.
Refactors the process invocation logic to use the .NET Process class for more robust output stream handling and to avoid temporary files.
Introduces a feature allowing users to specify additional success exit codes for applications in the UI. These codes are now considered successful during the installation process.
Adds a 'PAUSE' command to halt script execution and wait for user input.
Updates the build process to remove any existing Apps.iso during cleanup, ensuring a fresh build without stale artifacts.
Clarifies in the app script template that configuration variables are treated as strings. The examples are updated to reflect this, preventing potential errors in custom scripts when checking for boolean-like values.
Refactors the ADK URL retrieval logic to let `Invoke-WebRequest` handle the forward link redirection directly. This approach is more reliable than manually parsing the redirect response.
Adds a try/catch block to provide better error handling and logging during the URL resolution process.
Adds a new function to programmatically retrieve the required authentication token for the Lenovo PSREF API. This change is necessary as Lenovo is now restricting API access without a JavaScript-generated token.
The new function launches a headless browser instance, uses the DevTools protocol to extract the token from local storage, and then terminates the browser. This ensures continued access to the comprehensive model data available through the PSREF API, which is not fully present in other catalogs.
The User-Agent string has also been updated.
Updates the Win32 app installation script to handle WinGet-sourced apps and user-defined apps in two separate batches instead of merging them. This ensures all WinGet apps are installed before any user-defined apps.
The core installation logic is extracted into a reusable function, improving script structure and readability.
Additionally, removes a pause command and a redundant console message from other scripts to improve automation flow.
Change the dependency resolution logic from a single global scan to an isolated, per-application scan.
This prevents potential version conflicts that could occur if multiple applications require different versions of the same dependency package. Each application now resolves its dependencies only from its own dedicated 'Dependencies' folder, ensuring the correct versions are used and making the installation process more robust and reliable.
Refactors the application download logic to correctly handle packages from the 'msstore' source, which does not support architecture specification.
- The download process no longer passes an architecture parameter for msstore apps.
- The architecture selection dropdown in the UI is now disabled for msstore apps to prevent invalid configurations.
- Imported or searched msstore apps will display 'NA' for their architecture.
Refactors the Store app installation script to be significantly more robust and intelligent. The new implementation automatically resolves application dependencies instead of relying on a simple folder structure.
Key improvements include:
- Pre-scans all application folders to create a central catalog of available dependencies.
- Parses the `AppxManifest.xml` from each main app package (including from within bundles) to determine its true dependencies.
- Resolves the required dependencies by finding the best available package from the catalog that meets version and OS architecture requirements.
- Adds support for extracting zipped dependency packages.
- Improves temporary file management and logging.
Refactors the Winget search functionality to enhance performance and provide a better user experience.
- Updates the UI to show a wait cursor, disable the search button, and display a status message during the search operation.
- Improves the post-search status message to differentiate between new and total applications found.
- Utilizes `ForEach-Object -Parallel` to speed up the processing of search results on multi-core systems.