Commit Graph

805 Commits

Author SHA1 Message Date
rbalsleyMSFT 4032ed4e3f Docs: Update README with UI documentation status
Sets expectations that formal documentation for the new UI is still being written.

Directs users to the YouTube video for a demonstration and highlights the removal of `InstallAppsAndSysprep.cmd`.
2025-07-30 17:07:31 -07:00
rbalsleyMSFT 2147746ff9 Remove sample inbox app list
Deletes the sample JSON file containing a list of inbox applications as it is no longer required.
2025-07-30 16:39:05 -07:00
rbalsleyMSFT 819b3b4de7 Docs: Update and clarify README
Adds LTSC to the list of supported Windows versions and emphasizes the fast deployment time with bold formatting. Also includes minor typographic corrections.
2025-07-30 16:37:14 -07:00
rbalsleyMSFT 3a909c76e0 Implements dynamic retrieval of Lenovo PSREF API token
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.
2025-07-30 11:47:05 -07:00
rbalsleyMSFT 30c7f6f705 Refactor Win32 app installation to process sources separately
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.
2025-07-25 18:35:19 -07:00
rbalsleyMSFT b4f1985c99 Refactor dependency resolution to be app-specific
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.
2025-07-25 17:33:16 -07:00
rbalsleyMSFT c57e7ebdfe Improve architecture handling for msstore applications
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.
2025-07-25 15:29:25 -07:00
rbalsleyMSFT fc79251f66 Overhauls Store app installation with dependency resolution
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.
2025-07-25 14:31:03 -07:00
rbalsleyMSFT 93f6eeac87 Improves Winget search performance and user feedback
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.
2025-07-24 15:24:01 -07:00
rbalsleyMSFT 138fd1184c Remove debugging code
Removes temporary debug logging from the UI window's closed event handler.
2025-07-24 10:38:08 -07:00
rbalsleyMSFT 0f0e8e9f98 Reduces log noise for monitor tab auto-scroll
Removes the log message that is generated when auto-scrolling is enabled. This reduces log spam, as this can be a frequent event.

The message for when a user manually disables auto-scrolling is retained.
2025-07-24 09:39:10 -07:00
rbalsleyMSFT 576c0a82f8 Improve script output readability
Adds a blank line after each application installation command. This visually separates the output for each app, making the logs easier to read in the terminal.
2025-07-23 20:56:36 -07:00
rbalsleyMSFT 57cb349371 Improve driver injection logic and user feedback
Enhances the driver mapping logic to ensure JSON files with a single entry are handled correctly. The model matching is now more flexible, allowing for partial matches in either direction between the system's reported model and the mapping file.

Adds a user-facing message to indicate that the driver injection process may take a significant amount of time, preventing confusion about the script stalling.
2025-07-23 20:42:30 -07:00
rbalsleyMSFT 791040364b Improves error reporting for failed FFU builds
Refactors the error handling for failed build jobs to more reliably capture the root cause of the failure.

The logic now uses `Receive-Job` with an `ErrorVariable` to directly capture the error stream from the job, which provides a more accurate terminating error message than the previous method.

Additionally, the error message box now includes the full path to the log file, making it easier for the user to locate.
2025-07-23 19:37:51 -07:00
rbalsleyMSFT defd744ef0 Refactor winget download logic and error handling
Improves the reliability and clarity of the application download process.

- Introduces specific error codes for download failures, such as publisher restrictions from the Microsoft Store.
- Blocks downloading the Company Portal app from the `winget` source due to packaging issues and provides a user-friendly message.
- Refines status messages in the UI for better user feedback.
- Installs the WinGet PowerShell module for all users to prevent context-related issues.
2025-07-23 17:28:12 -07:00
rbalsleyMSFT 298809686b Add zip extraction and improve UWP app detection
Enhances the application download logic to automatically extract zip archives. This allows for handling packages that are delivered in a compressed format.

Improves the reliability of identifying UWP applications by iterating through all downloaded files instead of checking only the first one. This prevents errors when multiple files are present after download or extraction.
2025-07-22 16:00:11 -07:00
rbalsleyMSFT 1b80d008ef Stops running build job when UI is closed
Adds cleanup logic to the window's `Closed` event handler to properly terminate any active background build job.

This prevents the build process from becoming an orphaned job if the user closes the UI while a build is in progress. The change ensures the job, its polling timer, and log streams are all stopped and disposed of correctly.
2025-07-22 13:54:41 -07:00
rbalsleyMSFT 0e53e43c77 Improves Win32 app detection and logging
Refines the logic for verifying existing Win32 applications by checking for architecture-specific names (x86, x64, arm64).

Enhances validation by ensuring the application folder contains files of a sufficient size, not just that the folder exists.

Adds more detailed logging to aid in troubleshooting cases where an app is not found or its content is missing.
2025-07-21 19:12:10 -07:00
rbalsleyMSFT bb76d2edcf Refactor WinGet app existence check for multi-arch support
Improves the pre-download check to correctly identify existing multi-architecture applications by looking for both x86 and x64 subfolders.

This prevents unnecessary re-downloads of apps that have separate builds for each architecture. The logic is also consolidated to remove a redundant code block.
2025-07-21 17:48:59 -07:00
rbalsleyMSFT c9499d839c Improve performance of update comparison in cache lookup
Replaces the `Compare-Object` cmdlet with a faster, manual loop comparison on pre-sorted arrays to optimize the VHDX cache check for matching updates.

This change also refactors the extraction of update filenames for better readability and adds checks for empty collections to improve script robustness.
2025-07-21 16:13:14 -07:00
rbalsleyMSFT ba1dd3df6b Refactor: Simplify update package file lookup
Streamlines the logic for finding Cumulative Update (CU) and Cumulative Update Preview (CUP) files by removing redundant code.

The file search now relies directly on a wildcard search using the KB article ID, instead of first attempting a match with a specific filename. This change simplifies the script and makes the discovery process more direct. Also removes commented-out code.
2025-07-21 11:24:44 -07:00
rbalsleyMSFT 721f93d82d feat: Add per-app architecture selection and multi-arch downloads
Introduces the ability to specify and download multiple architectures for a single application.

- Adds an "Architecture" dropdown column to the Winget UI, allowing users to select the desired architecture(s) for each app (e.g., x86, x64, arm64, or 'x86 x64').
- Updates the download logic to process each specified architecture, creating separate subfolders for multi-architecture Win32 apps.
- Modifies the app list format to save and load the selected architecture for each application.
- Improves the download process by checking if an application has already been downloaded before attempting a new download.
2025-07-18 20:12:05 -07:00
rbalsleyMSFT 9df663dc9b Refactor to eliminate global variable dependencies
Removes the use of global variables for paths and architecture settings. Instead, these values are now passed explicitly as parameters to the relevant functions.

This change improves code clarity, reduces the risk of side effects, and makes the functions more modular and easier to test.
2025-07-18 17:25:39 -07:00
rbalsleyMSFT c535126605 Docs: Announce 2507.1 preview release
Updates the README to announce the new preview release, which features a major user interface update.

Removes an obsolete development zip archive.
2025-07-18 15:29:55 -07:00
rbalsleyMSFT 6df7b16cdf Docs: Add PowerShell comment-based help to all script modules
Adds standard PowerShell comment-based help blocks (synopsis and description) to all UI and common library script modules (`.psm1`) and the main UI entry point script (`.ps1`).

This improves maintainability and discoverability by documenting the purpose of each script file. Also removes various redundant or commented-out code blocks.
2025-07-18 14:52:03 -07:00
rbalsleyMSFT 7cc7919da4 Feat: Add configurable thread limit for parallel operations
Adds a "Threads" setting to the UI, allowing users to control the throttle limit for parallel tasks like driver and application processing.

This introduces a new textbox in the build options and updates the parallel processing function to use this configurable value instead of a hardcoded one.

Input validation is also added to ensure the threads value is a valid integer and is at least 1. The new setting is integrated into the configuration save/load functionality.
2025-07-18 13:45:58 -07:00
rbalsleyMSFT e639cee4ee Prevents adding duplicate application names
Adds a validation check to ensure application names are unique.

If a user attempts to add an application with a name that already exists, a warning message is displayed, and the operation is cancelled.
2025-07-17 18:28:09 -07:00
rbalsleyMSFT da299d8a03 Fix race condition in parallel UI status updates
Prevents stale, intermediate status messages from overwriting the final status of a completed task in the UI.

A set of completed task identifiers is now maintained. Any incoming intermediate status updates for tasks that are already marked as complete are ignored.

The job completion logic is also refactored for better robustness and clarity across different job-end states (failed, completed with data, completed without data).
2025-07-17 18:24:44 -07:00
rbalsleyMSFT b04a8460b0 Refactor BYO app copy and add overwrite confirmation
Improves the "Copy BYO Apps" functionality by centralizing the `UserAppList.json` update process. The application list is now saved once from the UI before starting the copy, rather than individually within each background task.

Adds a confirmation prompt that warns the user if any application folders already exist in the destination, allowing them to choose whether to overwrite them. The copy logic is updated to remove existing folders before copying to ensure a clean state.
2025-07-17 17:17:00 -07:00
rbalsleyMSFT 62b4816498 Improves application orchestration and BYO app handling
Enhances the orchestrator script to skip application installation steps if no corresponding app lists or files are present. This prevents unnecessary script executions and cleans up the output log.

Makes the 'Arguments' field optional when adding a 'Bring Your Own' application, simplifying the process for apps without arguments.

Ensures the 'Priority' field for applications is consistently saved as an integer to improve data integrity.
2025-07-17 16:50:38 -07:00
rbalsleyMSFT 56c811ad89 Forces capture media creation when installing apps
Removes the check for a pre-existing capture ISO when applications are being installed.

This change simplifies the logic by unconditionally creating the capture media if `InstallApps` is enabled. This ensures the media is always correctly configured for capturing the virtual machine to an FFU.
2025-07-17 12:22:04 -07:00
rbalsleyMSFT 71b3989083 Adds support for custom Office configuration XML
Introduces the ability to use a custom XML file for Office installation, allowing for more flexible configurations.

The build script now accepts an `OfficeConfigXMLFile` parameter. If provided, its filename will be used for the installation.

The Office Deployment Toolkit is now downloaded to the specified Office path instead of the development path. UI tooltips are updated to clarify this behavior.
2025-07-16 18:04:17 -07:00
rbalsleyMSFT e753344137 Refine Office configuration tooltips
Improves the tooltips for the Office installation path and configuration XML options.

The updated text provides clearer guidance on the purpose and usage of these settings.
2025-07-16 15:06:42 -07:00
rbalsleyMSFT bc32a8a10e Adds browse button for Office configuration file
Implements the click handler for the browse button associated with the Office configuration XML file path.

This change enables users to select the configuration file via a file dialog, automatically populating the path into the text field and improving usability.
2025-07-16 14:09:16 -07:00
rbalsleyMSFT 906f73f303 Refine driver models status column header
Shortens the "Download Status" column header to "Status" for a more concise UI.
2025-07-16 13:39:15 -07:00
rbalsleyMSFT d84c307593 Ensure capture media exists for app installation
Forces the creation of capture media if app installation is enabled and the capture ISO does not already exist.

This change prevents a failure later in the build process by ensuring the necessary media is available.
2025-07-16 13:30:12 -07:00
rbalsleyMSFT de8524b37c Refactor USB creation to use parallel processing
Improves the performance of creating multiple deployment USB drives by refactoring the process to run in parallel using `ForEach-Object -Parallel`.

Key changes:
- Mounts the deployment ISO once before processing begins, rather than for each individual drive.
- Partitions, formats, and copies files to multiple USB drives concurrently, significantly reducing the total time required.
- Simplifies and cleans up the FFU selection logic.
- Standardizes on `robocopy` for all large file transfer operations to improve performance and logging.
2025-07-16 13:05:22 -07:00
rbalsleyMSFT c67d8761e2 Fix ambiguous Windows Release selection on config load
Refines the logic for setting the Windows Release from a saved configuration to handle ambiguous values.

When a release value like '2019' exists for both Server and LTSC editions, the UI could select the wrong item. The logic now inspects the `WindowsSKU` config value to differentiate between them, correctly selecting the LTSC or non-LTSC release.
2025-07-16 11:27:21 -07:00
rbalsleyMSFT 7600ae86d1 Refactor update file discovery and cache comparison
Improves the reliability of finding update files (CU, CUP, .NET) by first using the exact filename from the update metadata. The script now only falls back to searching by KB article ID if the primary method fails.

Additionally, this enhances the VHDX cache lookup logic. The comparison now uses update file names extracted directly from their URLs, ensuring a more accurate match against the cached configuration.
2025-07-15 20:04:12 -07:00
rbalsleyMSFT 97e0998e1d Refactor update handling to improve VHDX caching logic
Separates the process of identifying required Windows updates from the download process itself. This allows for checking against the VHDX cache using a list of required updates before any files are downloaded, making the caching mechanism more efficient and reliable.

This change introduces a new `Get-UpdateFileInfo` function to gather update metadata. The main script logic is updated to first determine all necessary updates, then check for a suitable cached VHDX, and only download the updates if no valid cache item is found.
2025-07-15 17:43:08 -07:00
rbalsleyMSFT 5b85acbd73 Refactor(UI): Reorder tabs for a more logical workflow
Moves the "Build" tab to appear after the "Hyper-V Settings" tab. This change aligns the UI with the typical user process, creating a more intuitive sequence for configuration.
2025-07-14 18:09:59 -07:00
rbalsleyMSFT ca84f4dfea Implement conditional autoscroll in log monitor
Improves the user experience in the monitor tab by making the log output autoscroll conditional.

Autoscrolling is now disabled when the user selects a log entry other than the last one, allowing them to inspect previous output without interruption. Selecting the last item in the list re-enables autoscrolling.
2025-07-14 17:56:51 -07:00
rbalsleyMSFT 315f0f3858 Refactor: Remove unused BITS transfer function
Removes the `Start-BitsTransferWithRetry` function as it is no longer in use. This change cleans up the script by removing dead code.
2025-07-14 16:57:11 -07:00
rbalsleyMSFT 21d5f74dd8 Feat: Auto-save selected drivers and refine script execution
Adds a feature to automatically save the selected drivers to `Drivers.json` upon download, preserving the user's selection for future use.

Improves script execution by:
- Ensuring the disk cleanup process completes before proceeding.
- Suppressing progress bars globally for a cleaner console output.
- Hiding non-critical warnings during driver installation.
- Removing an unused BITS transfer function and trailing whitespace.
2025-07-14 16:55:15 -07:00
rbalsleyMSFT 08c9d5a0e3 feat: Add progress reporting to FFU build process
Introduces a progress reporting system to provide real-time feedback during the FFU build. This includes adding a progress bar and status messages to the UI, which are updated at key stages of the build process.

- Adds a new `Set-Progress` function to log progress updates.
- Integrates `Set-Progress` calls throughout the main build script.
- Updates the UI to parse progress logs and update the progress bar and status text.
- Improves error reporting in the UI to display more detailed failure reasons.
- Corrects a typo in the `LogicalSectorSizeBytes` parameter name in documentation and log messages.
2025-07-11 16:43:42 -07:00
rbalsleyMSFT 4a719b6c9a Improves reliability of build log monitoring
Deletes the old log file before starting a new build job to prevent the UI from displaying stale content from a previous run.

Replaces a fixed delay with a more robust wait loop that polls for the new log file's creation. This avoids a race condition where the monitor could fail to attach if the background job was slow to start. A timeout is included to prevent the UI from hanging.
2025-07-10 21:59:19 -07:00
rbalsleyMSFT 7043af47c3 Feat: Add live log monitoring tab to UI
Introduces a new "Monitor" tab in the `BuildFFUVM` UI to display live log output from the build process.

When a build is started, the UI now automatically switches to the Monitor tab. It tails the main log file in real-time and displays the content in a list view, which auto-scrolls as new entries appear.

This provides immediate visual feedback on the build progress and any errors without needing to manually open the log file.

Additionally, this change adds a Ctrl+C keyboard shortcut to copy selected log lines from the monitor view to the clipboard.
2025-07-10 19:56:59 -07:00
rbalsleyMSFT ebbb3e8ed0 Run build process in background job to keep UI responsive
Refactors the FFU build process to execute asynchronously using a background job. This prevents the UI from freezing during the build.

A timer now polls the job status and updates the UI with the final result (success or failure) upon completion. The build button is also disabled while a build is in progress to prevent multiple executions.
2025-07-10 18:00:03 -07:00
rbalsleyMSFT 863f0bba2c Refactor error handling and improve diagnostics
Introduces a centralized function to handle script termination, ensuring the DISM log is always copied on failure for easier debugging.

Improves user-facing error messages to provide clearer guidance for common issues, such as a missing hard drive, incorrect USB drive configuration, or FFU logical sector size mismatches.

Adds post-deployment verification to ensure the Windows partition is created and assigned a drive letter correctly after applying the FFU.
2025-07-10 16:09:15 -07:00
rbalsleyMSFT 7df81177de Enhance console output for readability and user experience
Refactors the script's console output to be cleaner and more user-friendly.

- Adds formatted section headers to clearly delineate each stage of the deployment process.
- Replaces verbose console logging with more selective and meaningful status messages for the user.
- Prevents external commands from opening new windows, creating a more seamless execution flow in the terminal.
2025-07-10 14:32:57 -07:00