mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 10:19:36 -06:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 65e52bb554 | |||
| c20829a72c | |||
| 7670ab886c | |||
| 9bacac8f3d |
@@ -2781,11 +2781,25 @@ function Add-BootFiles {
|
|||||||
[string]$OsPartitionDriveLetter,
|
[string]$OsPartitionDriveLetter,
|
||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
[string]$SystemPartitionDriveLetter,
|
[string]$SystemPartitionDriveLetter,
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$AdkPath,
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[ValidateSet('x86', 'x64', 'arm64')]
|
||||||
|
[string]$WindowsArch,
|
||||||
[string]$FirmwareType = 'UEFI'
|
[string]$FirmwareType = 'UEFI'
|
||||||
)
|
)
|
||||||
|
|
||||||
WriteLog "Adding boot files for `"$($OsPartitionDriveLetter):\Windows`" to System partition `"$($SystemPartitionDriveLetter):`"..."
|
# Use the ADK copy of BCDBoot so the boot binaries come from the validated ADK toolset
|
||||||
Invoke-Process bcdboot "$($OsPartitionDriveLetter):\Windows /S $($SystemPartitionDriveLetter): /F $FirmwareType" | Out-Null
|
# instead of the local OS installation, which can differ based on Secure Boot servicing state.
|
||||||
|
$bcdBootArchitecture = if ($WindowsArch -ieq 'arm64') { 'arm64' } else { 'amd64' }
|
||||||
|
$bcdBootPath = Join-Path $AdkPath "Assessment and Deployment Kit\Deployment Tools\$bcdBootArchitecture\BCDBoot\bcdboot.exe"
|
||||||
|
|
||||||
|
if (-not (Test-Path -Path $bcdBootPath)) {
|
||||||
|
throw "ADK BCDBoot was not found at $bcdBootPath"
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteLog "Adding boot files for `"$($OsPartitionDriveLetter):\Windows`" to System partition `"$($SystemPartitionDriveLetter):`" using ADK BCDBoot at `"$bcdBootPath`"..."
|
||||||
|
Invoke-Process $bcdBootPath "$($OsPartitionDriveLetter):\Windows /S $($SystemPartitionDriveLetter): /F $FirmwareType" | Out-Null
|
||||||
WriteLog "Done."
|
WriteLog "Done."
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3414,6 +3428,7 @@ function New-PEMedia {
|
|||||||
"en-us\WinPE-Scripting_en-us.cab",
|
"en-us\WinPE-Scripting_en-us.cab",
|
||||||
"WinPE-PowerShell.cab",
|
"WinPE-PowerShell.cab",
|
||||||
"en-us\WinPE-PowerShell_en-us.cab",
|
"en-us\WinPE-PowerShell_en-us.cab",
|
||||||
|
"WinPE-SecureBootCmdlets.cab",
|
||||||
"WinPE-StorageWMI.cab",
|
"WinPE-StorageWMI.cab",
|
||||||
"en-us\WinPE-StorageWMI_en-us.cab",
|
"en-us\WinPE-StorageWMI_en-us.cab",
|
||||||
"WinPE-DismCmdlets.cab",
|
"WinPE-DismCmdlets.cab",
|
||||||
@@ -5692,7 +5707,8 @@ If (Test-Path -Path "$FFUDevelopmentPath\dirty.txt") {
|
|||||||
Get-FFUEnvironment
|
Get-FFUEnvironment
|
||||||
}
|
}
|
||||||
WriteLog 'Creating dirty.txt file'
|
WriteLog 'Creating dirty.txt file'
|
||||||
New-Item -Path .\ -Name "dirty.txt" -ItemType "file" | Out-Null
|
$dirtyFilePath = Join-Path -Path $FFUDevelopmentPath -ChildPath 'dirty.txt'
|
||||||
|
New-Item -Path $dirtyFilePath -ItemType "file" | Out-Null
|
||||||
|
|
||||||
# Early CLI prompt for additional FFUs (only if enabled and not provided)
|
# Early CLI prompt for additional FFUs (only if enabled and not provided)
|
||||||
if ($BuildUSBDrive -and $CopyAdditionalFFUFiles -and ((-not $AdditionalFFUFiles) -or ($AdditionalFFUFiles.Count -eq 0))) {
|
if ($BuildUSBDrive -and $CopyAdditionalFFUFiles -and ((-not $AdditionalFFUFiles) -or ($AdditionalFFUFiles.Count -eq 0))) {
|
||||||
@@ -7024,7 +7040,7 @@ try {
|
|||||||
|
|
||||||
WriteLog 'All necessary partitions created.'
|
WriteLog 'All necessary partitions created.'
|
||||||
|
|
||||||
Add-BootFiles -OsPartitionDriveLetter $osPartitionDriveLetter -SystemPartitionDriveLetter $systemPartitionDriveLetter[1]
|
Add-BootFiles -OsPartitionDriveLetter $osPartitionDriveLetter -SystemPartitionDriveLetter $systemPartitionDriveLetter[1] -AdkPath $adkPath -WindowsArch $WindowsArch
|
||||||
|
|
||||||
#Add Windows packages
|
#Add Windows packages
|
||||||
if ($UpdateLatestCU -or $UpdateLatestNet -or $UpdatePreviewCU ) {
|
if ($UpdateLatestCU -or $UpdateLatestNet -or $UpdatePreviewCU ) {
|
||||||
@@ -7615,7 +7631,8 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#Clean up dirty.txt file
|
#Clean up dirty.txt file
|
||||||
Remove-Item -Path .\dirty.txt -Force | out-null
|
$dirtyFilePath = Join-Path -Path $FFUDevelopmentPath -ChildPath 'dirty.txt'
|
||||||
|
Remove-Item -Path $dirtyFilePath -Force | out-null
|
||||||
# Remove per-run session folder if present
|
# Remove per-run session folder if present
|
||||||
$sessionDir = Join-Path $FFUDevelopmentPath '.session'
|
$sessionDir = Join-Path $FFUDevelopmentPath '.session'
|
||||||
if (Test-Path -Path $sessionDir) {
|
if (Test-Path -Path $sessionDir) {
|
||||||
|
|||||||
@@ -295,6 +295,7 @@ $script:uiState.Controls.btnRun.Add_Click({
|
|||||||
$startCleanupParams = @{
|
$startCleanupParams = @{
|
||||||
FilePath = $pwshPath
|
FilePath = $pwshPath
|
||||||
ArgumentList = $cleanupArgs
|
ArgumentList = $cleanupArgs
|
||||||
|
WorkingDirectory = $ffuDevPath
|
||||||
PassThru = $true
|
PassThru = $true
|
||||||
}
|
}
|
||||||
if ($Host.Name -eq 'ConsoleHost') {
|
if ($Host.Name -eq 'ConsoleHost') {
|
||||||
@@ -457,6 +458,7 @@ $script:uiState.Controls.btnRun.Add_Click({
|
|||||||
$startBuildParams = @{
|
$startBuildParams = @{
|
||||||
FilePath = $pwshPath
|
FilePath = $pwshPath
|
||||||
ArgumentList = $pwshArgs
|
ArgumentList = $pwshArgs
|
||||||
|
WorkingDirectory = $config.FFUDevelopmentPath
|
||||||
PassThru = $true
|
PassThru = $true
|
||||||
}
|
}
|
||||||
if ($Host.Name -eq 'ConsoleHost') {
|
if ($Host.Name -eq 'ConsoleHost') {
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ function New-PEMedia {
|
|||||||
"en-us\WinPE-Scripting_en-us.cab",
|
"en-us\WinPE-Scripting_en-us.cab",
|
||||||
"WinPE-PowerShell.cab",
|
"WinPE-PowerShell.cab",
|
||||||
"en-us\WinPE-PowerShell_en-us.cab",
|
"en-us\WinPE-PowerShell_en-us.cab",
|
||||||
|
"WinPE-SecureBootCmdlets.cab",
|
||||||
"WinPE-StorageWMI.cab",
|
"WinPE-StorageWMI.cab",
|
||||||
"en-us\WinPE-StorageWMI_en-us.cab",
|
"en-us\WinPE-StorageWMI_en-us.cab",
|
||||||
"WinPE-DismCmdlets.cab",
|
"WinPE-DismCmdlets.cab",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user