Fixed an issue with Critical Process Died BSOD

When using -installapps $false when capturing a FFU, a Critical Process Died BSOD would happen when deploying the FFU and Windows attempted to load.

When capturing the FFU, the registry is loaded to grab the Windows version information to create the FFU file name. After unloading the registry, the FFU is captured. This process can happen too fast on certain hard drives (NVME). A 15 second delay was added after the unloading of the registry to allow for the process to complete before the FFU is captured.
This commit is contained in:
rbalsleyMSFT
2023-09-07 10:32:58 -07:00
parent f28281671e
commit 34efbda7ec
3 changed files with 13 additions and 6 deletions
+7 -3
View File
@@ -202,7 +202,7 @@ param(
[ValidateSet(512, 4096)]
[uint32]$LogicalSectorSizeBytes = 512
)
$version = '2306.1.2'
$version = '2309.1'
#Check if Hyper-V feature is installed (requires only checks the module)
$osInfo = Get-WmiObject -Class Win32_OperatingSystem
@@ -1009,11 +1009,10 @@ function New-FFU {
WriteLog "FFU file name: $FFUFileName"
$FFUFile = "$FFUCaptureLocation\$FFUFileName"
#Capture the FFU
WriteLog 'Capturing FFU from VHDX file'
#Invoke-Process cmd "/c ""$DandIEnv"" && dism /Capture-FFU /ImageFile:$FFUFile /CaptureDrive:\\.\PhysicalDrive$($vhdxDisk.DiskNumber) /Name:$($winverinfo.Name)$($winverinfo.DisplayVersion)$($winverinfo.SKU) /Compress:Default"
Invoke-Process cmd "/c dism /Capture-FFU /ImageFile:$FFUFile /CaptureDrive:\\.\PhysicalDrive$($vhdxDisk.DiskNumber) /Name:$($winverinfo.Name)$($winverinfo.DisplayVersion)$($winverinfo.SKU) /Compress:Default"
WriteLog 'FFU Capture complete'
WriteLog 'Sleeping 60 seconds before dismount of VHDX'
#WriteLog 'Sleeping 60 seconds before dismount of VHDX'
Dismount-ScratchVhdx -VhdxPath $VHDXPath
}
@@ -1149,6 +1148,11 @@ Function Get-WindowsVersionInfo {
WriteLog "Unloading registry"
Invoke-Process reg "unload HKLM\FFU"
#This prevents Critical Process Died errors you can have during deployment of the FFU. Capturing from very fast disks (NVME) can cause the capture to happen faster than Windows is ready for.
WriteLog 'Sleep 15 seconds to allow registry to completely unload'
Start-sleep 15
return @{