You may run into this issue when adding packages to Windows Image (install.wim) file. I will be discussing the reason for this error and how to resolve.
Here are some articles I have written on how to resolve some errors relating to Windows Images. Error 0xc1570103: The license file was not found in the specified path, and how to fix error 0xc1510114-The wim file needs to be remounted. How to fix error 0xc1510114-The wim file needs to be remounted, Error 0x80070002: When trying to mount an image file, Error code 15601: How to resolve DISM unspecified error when removing preinstalled packages, Error 0xc1420127-The specified image in the specified wim is already mounted for read and write access, and Error 740-Elevated permissions are required to run DISM. The below image is the output I got while trying to add packages to an install.wim file.
Note: The path and Cabinet (Cab) files were correctly specified but this error was still prompted because the PackageFamilyName (UWP) were renamed and the the DISM tool could not install the cabinet file with the file name. This sounds a bit strannge as some other packages were installed this way.
Solution: I was able to resolve this issue, by mounting the Feature on Demand (FoD) ISO and re-copied the needed packages without renaming them. Here is an example of a package “Microsoft-Windows-TabletPCMath-Package~31bf3856ad364e35~amd64~~.cab”. In this way, the packages were installed successfully. Please see this article on how to how to Add Packages to Windows image the DISM Tool.
dism /Image:G:\Path-to-the-mounted-wim-file\<MountedZ(mountedDirectory)> /Add-Package /PackagePath:G:\path-to-the-package\the-cabinet(cab)-file-to-be-added
After successfully adding the package to the WIM file, you should get a message as shown below
Deployment Image Servicing and Management tool
Image Version: xxxxxxxxxxx
Processing 1 of 1 - Adding package Microsoft-Windows-TabletPCMath-Package~31bf3856ad364e35~amd64~~.cab
The operation completed successfully.
I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.