FriendsOfMDT / PSD

PowerShell Deployment
MIT License
504 stars 78 forks source link

Issue with Boot image generation with branch cache #114

Open Khroners opened 9 months ago

Khroners commented 9 months ago

Hello, I have an issue using BranchCache and 2Pint Software.

Set-PSDBootImage2PintEnabled.log report this error :

<![LOG[BITS and BranchCache could not be added to the C:\MDT\PSD-DeploymentShare\Boot\LiteTouchPE_x64.wim boot image. Exit code: 1]LOG]!><time="22:28:40.806+000" date="12-16-2023" component="Set-PSDBootImage2PintEnabled.ps1:273" context="" type="2" thread="" file="">

After looking at all the scripts, i ran :

WinPEGen.exe "C:\MDT\PSD-DeploymentShare\Operating Systems\W11-23H2\W11-23H2.wim" 1 C:\MDT\PSD-DeploymentShare\Boot\LiteTouchPE_x64.wim 1

This is the original error :

Adding BITS as specified on the Command Line...
Setting up temporary paths...
Checking privileges to mount registry hives...Done!
Path to boot .wim file is valid.

We have write access to the boot .wim source file!
Path to source .wim file is valid.
Loading Image C:\MDT\PSD-DeploymentShare\Operating Systems\W11-23H2\W11-23H2.wim (this may take some time...)

Image has default language of fr-FR.
Loading Image C:\MDT\PSD-DeploymentShare\Boot\LiteTouchPE_x64.wim (this may take some time...)

Image has default language of en-US.
Source default languange of fr-FR doest not match boot image value of en-US

I think this error is due to the boot image being generated in en-US. Is there a way to specify that the boot image need to be generated in fr-FR ?

Thanks in advance.

Alexis.

Khroners commented 9 months ago

Kinda resolved with :

Mount-WindowsImage -Path "C:\Mount" -ImagePath "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim" -Index 1 -Verbose
Add-WindowsPackage -PackagePath "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\fr-FR\lp.cab" -Path "C:\Mount" -Verbose
DISM /image:C:\Mount /set-UILang:fr-FR
DISM /image:C:\Mount /Set-SysLocale:fr-FR
DISM /image:C:\Mount /set-UserLocale:fr-FR
DISM /image:C:\Mount /set-InputLocale:fr-FR
Remove-WindowsPackage -Path "C:\mount" -PackageName Microsoft-Windows-WinPE-LanguagePack-Package~31bf3856ad364e35~amd64~en-US~10.0.25398.1
Start-Process "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe" -ArgumentList " /Image:`"C:\Mount`" /Cleanup-image /StartComponentCleanup /Resetbase /Defer" -Wait -LoadUserProfile
Start-Process "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe" -ArgumentList " /Image:`"C:\Mount`" /Cleanup-image /StartComponentCleanup /Resetbase" -Wait -LoadUserProfile`
Dismount-WindowsImage -Path "C:\Mount" -Save -Verbose
Export-WindowsImage -SourceImagePath "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim" -SourceIndex 1 -DestinationImagePath "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe-export.wim" -CompressionType max -Verbose
Remove-Item -Path "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim" -Force

But now the build number do not match :

Path to source .wim file is valid.
Loading Image C:\MDT\PSD-DeploymentShare\Operating Systems\W11-23H2\W11-23H2.wim (this may take some time...)

Image has default language of fr-FR.
Loading Image C:\MDT\PSD-DeploymentShare\Boot\LiteTouchPE_x64.wim (this may take some time...)

Image has default language of fr-FR.
Source default languange of fr-FR matches boot image value of fr-FR
Boot Image is untouched, continuing...

Boot Architecture is amd64
Source Architecture is amd64
Source Architecture amd64 matching destination architecture amd64
Checking Source and Boot Wim Editions...
Source SKU Edition is Professional
Source Image is Professional Edition, which is supported with BITS option.
Checking Source and Boot Wim Build Numbers...
Boot BuildNumber is 25398
Source BuildNumber is 22631
Source BuildNumber 22631 not matching destination BuildNumber 25398, cleaning up

I'm using ADK sept 2023.