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.
This commit is contained in:
rbalsleyMSFT
2025-07-16 13:30:12 -07:00
parent de8524b37c
commit d84c307593
+14
View File
@@ -3771,6 +3771,20 @@ if ($CopyUnattend) {
WriteLog 'Unattend validation complete' WriteLog 'Unattend validation complete'
} }
# If InstallApps is true, we need capture media.
if ($InstallApps) {
if (-not $CreateCaptureMedia) {
if (-not (Test-Path -Path $CaptureISO)) {
WriteLog "InstallApps is true, but CreateCaptureMedia is false and the capture ISO does not exist at $CaptureISO."
WriteLog "Forcing CreateCaptureMedia to true to build the required capture media."
$CreateCaptureMedia = $true
}
else {
WriteLog "InstallApps is true. Using existing capture media found at $CaptureISO."
}
}
}
#Override $InstallApps value if using ESD to build FFU. This is due to a strange issue where building the FFU #Override $InstallApps value if using ESD to build FFU. This is due to a strange issue where building the FFU
#from vhdx doesn't work (you get an older style OOBE screen and get stuck in an OOBE reboot loop when hitting next). #from vhdx doesn't work (you get an older style OOBE screen and get stuck in an OOBE reboot loop when hitting next).
#This behavior doesn't happen with WIM files. #This behavior doesn't happen with WIM files.