MSEndpointMgr

Fix Windows ADK version 1809 issue with crashing WPF applications

Since the release of Windows ADK version 1809 a couple of weeks back now, reports has been coming in on twitter and to me by email that the ConfigMgr OSD FrontEnd, among other WPF based applications are crashing. A quick and dirty fix up until now has been to replace the UIAutomationCore.dll file present in the winpe.wim file with the one from the Windows ADK version 1803. Even though it was a working fix, I’ve never really liked the work around.

So what can we do to fix this? David Segura (@SeguraOSD) looked into this issue and found out what the problem really is.

For a more detailed walk through of the issue, David has blogged about it on the link below:

https://www.osdeploy.com/blog/winpe-10-1809-wpf-dramarama

How to fix WPF applications crashing

If you didn’t read David’s blog post, he mentions that the exported winpe.wim file from the boot.wim file (index 1) coming with the Windows 10 version 1809 source media doesn’t have the same issue like the winpe.wim file included in Windows ADK version 1809. Essentially, there’s two missing files in the winpe.wim file from Windows ADK version 1809:

  • BCP47Langs.dll
  • BCP47mrm.dll

In this blog post you’ll find a PowerShell script that I put together to easily update your existing boot images that have already been reloaded from Windows ADK version 1809. Before running the script below, I suggest that you make a copy of the boot.wim /winpe.wim file being used in the boot image.

# Variables
$SourceMountPath = "C:\Temp\Mount\Source" # Create this folder
$BootImageMountPath = "C:\Temp\Mount\Current" # Create this folder
$SourceExportFolder = "C:\Temp\Export" # Create this folder
$SourceBootPath = "C:\Temp\Export\boot.wim" # boot.wim file copied to this location from the Windows 10 1809 x64 source media
$BootImagePath = "" # Local path to your boot.wim / winpe.wim file (not boot.PACKAGEID.wim) for your boot image in ConfigMgr

# Export winpe.wim from boot.wim from Windows 10 1809 source files
$ExportImagePath = Join-Path -Path $SourceExportFolder -ChildPath "winpe.wim"
Export-WindowsImage -SourceImagePath $SourceBootPath -DestinationImagePath $ExportImagePath -SourceIndex 1

# Mount exported WinPE image
Mount-WindowsImage -ImagePath $ExportImagePath -Index 1 -Path $SourceMountPath

# Mount boot image
Mount-WindowsImage -ImagePath $BootImagePath -Index 1 -Path $BootImageMountPath

# Copy BCP47*.dll's
$SourceFilePath = Join-Path -Path $SourceMountPath -ChildPath "Windows\System32\*"
$BootImageFilePath = Join-Path -Path $BootImageMountPath -ChildPath "Windows\System32"
Copy-Item -Path $SourceFilePath -Destination $BootImageFilePath -Filter "BCP47*.dll" -Force

# Dismount exported WinPE image
Dismount-WindowsImage -Path $SourceMountPath -Discard

# Dismount boot image
Dismount-WindowsImage -Path $BootImageMountPath -Save

Here’s how to use the script:

  • Make sure that you have access to a Windows 10 version 1809 64-bit ISO file and extract it’s content to a location in your site server.
  • Create the required folders for exporting and mounting:
    • C:\Temp\Mount\Source
    • C:\Temp\Mount\Current
    • C:\Temp\Export
  • Copy the boot.wim file from the extracted location of Windows 10 version 1809 64-bit to the C:\Temp\Export folder.
  • Update the $BootImagePath variable in the PowerShell script with the local path to the boot.wim / winpe.wim found in the data source of your boot image (remember to include the file name).
  • Execute the script.

There’s no useful output from the script, however if there’s no red errors, it’s all grand. Now redistribute your updated boot image to your distribution points. Your boot image should now be able to run WPF applications again once this has been completed, see screenshot below from a virtual machine booting on a winpe.wim image from Windows ADK version 1809 that has been updates with the two missing dll’s:

Once again, all credit to David Segura that figured this out!

Nickolaj Andersen

Chief Technical Architect and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences such as Microsoft Ignite, NIC Conference and IT/Dev Connections including nordic user groups.

5 comments

  • Thanks again for the automation, Nickolaj!

    DISM used by my PowerShell is not the version from my updated ADK 1809. Some have said they import the module and change env path like below. How do you handle updating PowerShell to use latest DISM after updating ADK?

    import-module “E:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM”

    $env:Path = “E:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM;$env:Path”

    • Hi Cordell,

      I simply just figure out where the installation path for ADK is using the registry and then build together the path for DISM and use that to invoke it.

      Regards,
      Nickolaj

      • Thanks Nikolaj, that is what I did but thought I should be setting PowerShell to know where to find the latest version every time. Appreciate your reply.

Sponsors

Categories

MSEndpointMgr.com use cookies to ensure that we give you the best experience on our website.