Commit Graph

691 Commits

Author SHA1 Message Date
rbalsleyMSFT 2d6f6e5cb0 Silences Robocopy output during VHDX caching
Reduces build log noise by discarding Robocopy output when copying cached VHDX files, keeping logs focused on actionable messages.
2026-02-03 16:27:36 -08:00
rbalsleyMSFT 5580824ac9 Suppresses volume format output during USB setup
Reduces console noise by discarding formatting command output, improving script readability in logs and interactive runs
2026-02-03 16:25:19 -08:00
rbalsleyMSFT ed0266029a Improves USB drive selection for same-model drives
Preserves multiple selected drives that share the same model by storing an array of UniqueIds per model.

Updates drive discovery and UI restore logic to accept either a single UniqueId or a list, preventing missed selections and skipping duplicate additions.
2026-02-03 13:37:58 -08:00
rbalsleyMSFT 1feed40962 Runs builds in pwsh process for reliable cancel
Improves UI responsiveness and interactive behavior by running build/cleanup in a separate PowerShell process instead of background jobs.

Fixes cancellation reliability by terminating the full process tree (including child tools) and using process exit codes for success/failure reporting.

Reduces noisy output by suppressing type-add return values and standardizes cleanup argument passing to avoid switch/boolean binding issues.
2026-01-29 22:21:15 -08:00
rbalsleyMSFT b2a7ef5f41 Improves Windows image index selection
Updates selection to match images by language-independent edition metadata instead of localized names, reducing failures across ISO/ESD sources and languages.

Adds server Desktop Experience vs Core handling via installation type and prefers the best match deterministically, falling back to a user prompt only when needed with better logging.
2026-01-29 16:44:46 -08:00
rbalsleyMSFT 65e5ce0c63 Merge pull request #393 from JGehl99/UI
Replaced deprecated Get-WmiObject calls with Get-CimInstance.
2026-01-28 18:28:05 -08:00
rbalsleyMSFT 2de2d9ccb6 Merge pull request #394 from rbalsleyMSFT/SurfaceMapping
Surface mapping
2026-01-28 18:26:46 -08:00
rbalsleyMSFT 7231f620c8 Improve driver injection error handling and resilience
Enhances the driver installation process to be more resilient by allowing non-critical driver injection failures to not halt the entire deployment. Key improvements include:

- Adds `IgnoreExitCode` and `PassThruExitCode` parameters to the process invocation function, enabling callers to handle non-zero exit codes without throwing exceptions.

- Modifies driver injection logic (both WIM and folder-based) to capture exit codes and log warnings instead of failing the deployment when drivers fail to inject.

- Automatically collects and preserves diagnostic logs (dism.log and setupapi.offline.log) to the USB drive when driver installation encounters issues, aiding post-deployment troubleshooting.

- Wraps cleanup operations in try-catch blocks to ensure temporary resources are released even if unmounting or deletion fails.

- Fixes code formatting inconsistencies and indentation throughout the script for improved readability.

This approach prioritizes deployment completion while preserving critical diagnostic information when driver-related issues occur.
2026-01-28 18:10:18 -08:00
jgehl99 6df32b6b34 Replaced deprecated Get-WmiObject calls with Get-CimInstance. 2026-01-28 16:43:34 -05:00
rbalsleyMSFT 02e429d99d Adds TTL-based refresh for Surface cache
Treats driver index cache older than 7 days as stale to trigger re-downloads and avoid outdated metadata.

Improves resiliency by falling back to a refresh when the cache timestamp can’t be read, and adds clearer logging for cache age and refresh decisions.
2026-01-22 17:26:49 -08:00
rbalsleyMSFT 554964f57c Improves driver downloads by using cached links
Reduces unnecessary Download Center requests by preferring cached file details when available

Falls back to downloading/parsing the page only on cache miss, then backfills the cache for future runs

Adds error handling and logging around cache load/update to avoid download failures from cache issues
2026-01-22 17:10:50 -08:00
rbalsleyMSFT 866fa254f6 Improves Surface driver matching via System SKU
Adds best-effort Surface System SKU resolution and persists it into driver mappings to reduce model-name ambiguity during deployment.

Speeds up Microsoft model discovery by using a local cache and updates cached Download Center details during driver downloads to keep the UI responsive.

Prefers System SKU-based rule selection for Microsoft devices, falling back to legacy model-string matching when SKU data is unavailable.
2026-01-22 17:06:28 -08:00
rbalsleyMSFT 9d39ec8802 Updates changelog for 2601.1 UI preview
Highlights fixes for missing WinPE driver copies and long-path driver injection issues.

Notes improvements to winget app handling: prevents JSON corruption during parallel updates, enforces install order, and adds dependency/deduplication support.
v2601.1Preview
2026-01-13 11:25:21 -08:00
rbalsleyMSFT e3a4634d3c Updates preview version to 2601.1
Keeps build and deployment scripts aligned on the current preview release for consistent output and logging.
2026-01-13 10:49:00 -08:00
rbalsleyMSFT ad35a0b7f9 Adds Winget Win32 dependency handling and ordering
Some apps (Camtasia) require dependency apps to be installed first. Winget will download said dependency apps. This commit will place those dependencies before the calling app in the WingetWin32Apps.json file.
2026-01-12 18:12:26 -08:00
rbalsleyMSFT b2352e338b Ensures winget installs follow AppList order
Adds post-processing to reorder and re-prioritize winget app entries so install order stays consistent with the configured list, even when parallel downloads append results in completion order.

Serializes updates with a named mutex and writes changes atomically to avoid races and partial writes, with logging around failure cases.
2026-01-09 18:15:51 -08:00
rbalsleyMSFT 53741632a4 Prevents JSON corruption during parallel app updates
Adds cross-process locking and atomic writes to avoid race conditions and partial writes when multiple runspaces update the app command metadata in parallel.

Improves resilience by backing up and rebuilding when existing JSON is malformed, ensuring the build continues safely.
2026-01-09 18:05:36 -08:00
rbalsleyMSFT e9652daba9 Improves driver injection for long paths
Adds a SUBST-based DISM injection loop to avoid path-length failures when adding large driver sets.

Improves INI/INF parsing reliability with Unicode API settings, a larger auto-growing buffer, and normalization of GUID values.

Hardens driver copying by using long-path prefixes and literal paths, reducing copy errors on deeply nested driver folders.
2026-01-09 10:44:22 -08:00
rbalsleyMSFT ed5b7f669f Improves PE driver copy reliability and logging
Fixes buffer truncation in Get-PrivateProfileSection by dynamically
growing the buffer when large INF sections are encountered.

Enhances Copy-Drivers with comprehensive error handling, file existence
checks, and detailed logging for each operation. Adds support for
architecture-specific SourceDisksFiles sections (amd64/arm64) and
provides a summary of matched, skipped, and copied files.

Fixes key-value parsing to handle values containing equals signs.
2026-01-06 17:00:42 -08:00
rbalsleyMSFT ceeabd1ebc Add changelog for 2512.1 UI Preview release
Documents new features including shared cleanup module, Windows Security
Platform install delay, persistent KB folder for updates, and CU download
skipping when ESD is current.

Fixes WingetWin32Apps.json creation bug for pre-downloaded applications.
2512.1 v2512.1Preview
2026-01-05 12:34:58 -08:00
rbalsleyMSFT 15149ffa0b Bumps version to 2512.1Preview
Updates version string in BuildFFUVM.ps1 and ApplyFFU.ps1
from 2511.2Preview to 2512.1Preview for the new release.
2026-01-05 12:33:34 -08:00
rbalsleyMSFT 2f180747b7 Bumps version to 2511.2Preview
Updates version string in BuildFFUVM.ps1 and ApplyFFU.ps1
to reflect the new preview release.
2026-01-05 12:10:35 -08:00
rbalsleyMSFT 25fe90253c Regenerate Win32 app JSON for pre-downloaded content
Ensures CLI builds properly register silent install commands even when
app content already exists and download is skipped.
2026-01-05 12:07:16 -08:00
rbalsleyMSFT 86d122aacf Skips CU downloads when ESD version is current or newer
Extracts ESD metadata resolution into a separate function to enable
version comparison before downloading cumulative updates.

Parses Windows version from both ESD filenames and KB article search
results to determine if the ESD already contains the latest updates,
avoiding redundant downloads and installations.

Improves VHDX cache matching by tracking update names that were skipped
due to version matching, ensuring cached images are correctly reused
when updates are already integrated in the base image.

Adds check to skip downloading updates that already exist locally.

Removes prior behavior of always removing the KB folder. The `$RemoveUpdates` parameter now controls whether the KB folder is removed or not. This change was made due to the size of the Windows 11 CU being > 3-4GB. This will reduce bandwidth, however will require setting `$RemoveUpdates` to true to cleanup old update files.
2025-12-20 15:52:28 -08:00
rbalsleyMSFT 9737d5c930 Centralizes KB path cleanup into common cleanup module
Removes duplicated KB path cleanup logic scattered across multiple locations in the build script and consolidates it into the shared cleanup module.

Adds KBPath parameter to the cleanup function and handles removal of Windows/.NET cumulative update downloads when RemoveUpdates flag is set.

Improves maintainability by eliminating redundant cleanup code and ensures consistent cleanup behavior across different build scenarios including standard builds, VHDX caching, and restore defaults operations.
2025-12-16 21:18:42 -08:00
rbalsleyMSFT c6088d91fa Add 30 second delay to allow for Windows Security Platform to install in Update-Defender.ps1 2025-12-15 16:21:27 -08:00
rbalsleyMSFT 15fdf77ce4 Refactors cleanup logic into shared module
Consolidates duplicated cleanup code by moving logic into a shared function, eliminating redundant implementations across multiple locations.

Removes standalone cleanup functions (Remove-FFU, Remove-Apps, Remove-Updates) and replaces scattered cleanup calls with a single invocation of Invoke-FFUPostBuildCleanup.

Enhances driver cleanup to preserve configuration files (Drivers.json and DriverMapping.json) while removing other contents, preventing loss of driver mapping data.

Improves maintainability by centralizing cleanup operations and reducing code duplication, making future updates easier to implement consistently.
2025-12-15 16:20:01 -08:00
rbalsleyMSFT f7f001ac2e Update ChangeLog for version 2511.1
Added detailed changelog for version 2511.1, including major updates to driver handling, new hardware support, and various fixes.
2025-12-09 18:00:10 -08:00
rbalsleyMSFT 3524d02047 Adds interactive disk selection for multi-disk systems
Improves disk selection logic to handle systems with multiple fixed disks by prompting the user to choose the target disk when more than one candidate is detected.

Refactors Get-HardDrive to return an array of disk candidates instead of a single disk object with extracted properties, enabling the main script to present options and validate user selection.

Displays disk information in a formatted table showing disk number, size, sector size, bus type, and model to help users make informed decisions.

Validates user input to ensure only available disk numbers can be selected, preventing deployment errors on multi-disk configurations.

Maintains single-disk auto-selection behavior for systems with only one fixed disk, preserving the original user experience for common scenarios.
v2511.1preview
2025-12-08 18:24:20 -08:00
rbalsleyMSFT 7948201e18 Replace web request with BITS transfer for ESD downloads
Switches from using Invoke-WebRequest to Start-BitsTransferWithRetry for downloading Windows ESD files. This provides better reliability and automatic retry handling for large file downloads.

Also removes trailing blank lines for cleaner formatting.
2025-11-29 18:44:34 -08:00
rbalsleyMSFT 8d84137a27 Refactor app download logic for code reuse between UI and CLI
Moves the `Start-WingetAppDownloadTask` function from the UI module to the common module to enable parallel app downloads in both CLI and UI build paths. This eliminates code duplication and ensures consistent download behavior across build modes.

Updates the `Get-Apps` function to leverage parallel processing instead of sequential iteration, improving performance when downloading multiple applications. Adds support for `LogFilePath` and `ThrottleLimit` parameters to control logging and concurrency.

Introduces a `SkipWin32Json` parameter to differentiate behavior between UI mode (skips JSON generation) and CLI mode (creates JSON for installation). This allows the same download task to work correctly in both contexts.

Updates all callers of `Get-Apps` to pass the new parameters, ensuring proper logging and parallel execution configuration across the build pipeline.
2025-11-29 16:29:52 -08:00
rbalsleyMSFT 2273cffbc2 Add Threads parameter to control parallel driver download throttling
Introduces a new `Threads` parameter that allows users to configure the concurrency level for parallel driver downloads within the script. This parameter defaults to 5, matching the existing UI behavior, and accepts values between 1 and 64 to provide flexible control over resource utilization.

The parameter is now passed to the parallel processing function via the `ThrottleLimit` argument, enabling users to optimize performance based on their system capabilities and network conditions.
2025-11-29 13:57:54 -08:00
rbalsleyMSFT 63ef35a005 Fix USB drive detection logic for empty arrays
Replaces null comparison with count check to properly handle empty arrays. The previous condition would incorrectly pass when the array exists but contains no elements, potentially causing the function to proceed without a valid USB drive.
2025-11-24 17:41:36 -08:00
rbalsleyMSFT 417be73b23 Replace SerialNumber with UniqueId for USB drive identification
Switches USB drive matching logic from relying on SerialNumber to using UniqueId, which provides more reliable and consistent device identification across different systems.

Updates the Get-USBDrive function to retrieve UniqueId via Get-Disk and trims the machine name suffix (characters after colon) for consistent matching. The new approach first filters candidates by model and media type, then validates each candidate against the configured UniqueId.

Reflects this change across the UI layer by updating column headers, configuration handling, and drive enumeration functions to use UniqueId instead of SerialNumber for saving and loading USB drive selections.
2025-11-24 16:46:57 -08:00
rbalsleyMSFT 18367219c8 Fix xcopy command to handle PPKG filenames with spaces
Adds proper quoting around file paths in the xcopy invocation to support PPKG filenames containing spaces. Without quoted paths, xcopy fails when filenames include whitespace characters.
2025-11-24 15:32:02 -08:00
rbalsleyMSFT 2a77cf1a02 Add MSI path quoting to handle spaces in msiexec arguments
Introduces a new function to detect and properly quote unquoted MSI file paths in msiexec command arguments. This prevents installation failures when MSI paths contain spaces, as the Windows installer requires quoted paths to correctly parse arguments with whitespace.

The solution uses pattern matching to identify `/i` arguments followed by unquoted `.msi` file paths and automatically wraps them in double quotes. This runs automatically during application installation when msiexec is detected, ensuring reliable installations regardless of path formatting in the configuration.
2025-11-24 14:58:00 -08:00
rbalsleyMSFT 41b0f7d742 Escape quotes in MSI installation example tooltip
Updates the tooltip text for application arguments to properly escape quotes around the MSI file path in the example command. This ensures the example is syntactically correct and prevents issues when users copy the suggested format for MSI installations.
2025-11-24 14:03:11 -08:00
rbalsleyMSFT 24c81c234f Remove redundant Images directory creation logic 2025-11-21 22:59:46 -08:00
rbalsleyMSFT 4833d9f00d Merge branch 'UI_2510' of https://github.com/rbalsleyMSFT/FFU into UI_2510 2025-11-21 17:26:52 -08:00
rbalsleyMSFT 37e3497522 Bump version to 2511.1Preview
Please read - potential breaking change with Drivers you'll want to be aware of - https://github.com/rbalsleyMSFT/FFU/discussions/350
2025-11-21 17:25:23 -08:00
rbalsleyMSFT 8229aa73fe Add BITS transfer priority configuration support
Introduces a new parameter to control BITS download priority across the build system and UI, allowing users to optimize transfer speeds when needed.

The feature adds a priority selector to the UI with four options (Foreground, High, Normal, Low) and propagates the selection through the build script and common modules. Priority can be set via UI, command-line parameter, or environment variable, with Normal as the default.

Updates the BITS transfer retry logic to respect the configured priority instead of hardcoding Normal priority, and fixes minor code formatting inconsistencies.
2025-11-21 14:04:52 -08:00
rbalsleyMSFT e67590d0a1 Add HTTP fallback for BITS transfer network authentication errors
Enhances the BITS transfer retry logic to detect when the current session lacks network authentication and automatically falls back to Invoke-WebRequest for completion.

Detects the "not logged on to the network" error condition by checking both the HResult code (0x800704DD) and error message patterns, then triggers an HTTP-based fallback mechanism to retry the download with remaining attempts.

This ensures downloads can succeed even when BITS fails due to authentication issues, improving reliability of the transfer function in environments with network authentication requirements.
2025-11-20 18:02:59 -08:00
rbalsleyMSFT 33f0608d84 Remove redundant progress status update in driver package processing
Eliminates an unnecessary progress queue update that occurs immediately before downloading package XML, as this status message duplicates information already provided in the subsequent log message.

This simplifies the progress reporting flow and reduces redundant communication to the progress queue without impacting user-facing functionality.
2025-11-20 17:19:20 -08:00
rbalsleyMSFT 3d1a586c73 Refactor driver cleanup logic into reusable helper function
Extracts duplicate folder removal code across multiple driver modules (Dell, HP, Lenovo, Microsoft) into a centralized `Remove-DriverModelFolder` helper function. This new utility includes safety checks to prevent accidental deletion of the drivers root directory or paths outside the drivers folder hierarchy.

Also moves model path construction in the Microsoft driver module earlier in the function to ensure consistent path handling before any operations that might fail.

Benefits improved maintainability, reduces code duplication, and adds protective safeguards for destructive operations during error handling.
2025-11-20 17:05:31 -08:00
rbalsleyMSFT 7d36253668 Standardize driver compression status reporting across vendors
Updates compression workflow to use consistent status messaging and better error handling across all driver vendor modules (Dell, HP, Lenovo, Microsoft).

Changes improve status tracking by:
- Standardizing compression success status to "Compression successful" instead of vendor-specific messages
- Introducing relative path variables to reduce code duplication and improve maintainability
- Suppressing command output by piping to `$null` for cleaner execution
- Adding explicit failure state in exception handlers to ensure success property reflects actual outcome
- Updating parallel processing logic to recognize the new standardized compression status

These modifications ensure consistent behavior across vendors and make the parallel processing coordinator aware of all compression completion states.
2025-11-20 14:32:54 -08:00
rbalsleyMSFT e076e9f4ca Add option to skip driver installation during deployment
Allows users to bypass driver installation by entering 0 at the selection prompt, providing flexibility for deployments that don't require driver updates.

Introduces a skip flag and restructures the selection validation logic to accept either a valid driver selection or a skip command. When skipped, driver-related variables are set to null and appropriate logging messages are generated.
2025-11-19 23:58:29 -08:00
rbalsleyMSFT 44aa4d3a32 Add SUBST drive mapping for driver injection to handle long paths
Introduces helper functions to create and remove SUBST drive mappings for driver folders, addressing potential issues with long file paths during driver injection.

The new implementation:
- Adds `Get-AvailableDriveLetter` to find an unused drive letter
- Adds `New-DriverSubstMapping` to create a virtual drive mapping to the source folder
- Adds `Remove-DriverSubstMapping` to clean up the mapping after use
- Updates the driver injection workflow to use the mapped drive path instead of the original path
- Wraps the operation in try-catch-finally to ensure cleanup occurs even on errors

This approach mitigates issues with excessively long driver folder paths that could exceed command-line limits or cause path-related failures during DISM operations.
2025-11-19 23:08:39 -08:00
rbalsleyMSFT a1d08b6fa4 Simplifies driver folder discovery logic
Removes hardcoded manufacturer name list and treats all immediate child folders under the Drivers path as potential manufacturer containers. This supports both known vendors (Dell, HP, Lenovo, Microsoft) and unknown/custom manufacturers without requiring code changes.

Adds support for manufacturer folders that directly contain installable driver content (no model subfolders), enabling flatter folder structures when appropriate.

Improves code readability by consolidating the folder processing logic into a single loop that checks for model subfolders first, then falls back to treating the manufacturer folder itself as a driver source if it contains installable content.
2025-11-18 23:48:07 -08:00
rbalsleyMSFT fc4a71f7e1 Restricts manufacturer folder detection to known OEMs
Improves driver folder discovery logic by explicitly defining recognized manufacturer folder names (Dell, HP, Lenovo, Microsoft) instead of treating any root-level folder with children as a manufacturer folder.

Prevents incorrect categorization of non-manufacturer folders at the root level and ensures only legitimate OEM folders are processed for model-specific driver packages.

Refactors control flow to eliminate else block, improving code clarity and maintainability.
2025-11-18 20:03:22 -08:00
rbalsleyMSFT 9a59b9fea4 Removes Path column from driver source table display
Simplifies the driver source selection table by removing the full Path column from the formatted output.

The RelativePath column already provides sufficient information for users to identify driver sources, making the full path redundant and cluttering the display.
2025-11-18 18:59:38 -08:00