This will work with any modern version of Windows PE (so the Windows 8 one is fine, as is the edition for Windows 10). I've personally used the Windows 8.1 ADK with success. In the feature selection stage of the installer, make sure you have Deployment Tools and of course WinPE.
Then you can run an appropriately modified version of this batch script as an administrator from the "Deployment and Imaging Tools Environment":
@echo off
set _=%CD%
set PF=C:\Program Files
if exist "C:\Program Files (x86)\" set PF=C:\Program Files (x86)
echo Preparing PE workspace...
call copype.cmd x86 scratch\ > nul
cd %_%
echo Mounting image...
dism /Mount-Wim /WimFile:scratch\media\sources\boot.wim /index:1 /MountDir:scratch\mount > nul
echo Injecting WMI packages...
dism /image:scratch\mount /Add-Package /PackagePath:"%PF%\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-WMI.cab" > nul
dism /image:scratch\mount /Add-Package /PackagePath:"%PF%\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-WMI_en-us.cab" > nul
echo Injecting .NET packages...
dism /image:scratch\mount /Add-Package /PackagePath:"%PF%\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\WinPE-NetFX.cab" > nul
dism /image:scratch\mount /Add-Package /PackagePath:"%PF%\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\x86\WinPE_OCs\en-us\WinPE-NetFx_en-us.cab" > nul
echo Adding files...
REM: Add commands to copy in the appropriate files here
REM: Or insert a "pause" so you can manually do it in Explorer
echo Unmounting image...
dism /Unmount-Wim /MountDir:scratch\mount /Commit > nul
echo Finishing up...
move scratch\media\sources\boot.wim boot.wim > nul
rmdir /s /q scratch > nul
The %PF%
stuff is there so it can automatically detect where the Windows Kits folder is, which depends on the bitness of the technician computer. If you use a different version of the ADK, change all the instances of 8.1
to the folder name of your kit. The important part is where it adds the WMI and .NET packages. (The .NET one depends on WMI.) The final boot.wim
file produced will be able to run .NET applications that are the same bitness as the WinPE environment.
@PetrMolek Glad I could help! If my answer completely solved the problem, you can click the check mark next to it to indicate to future readers that this is the solution. – Ben N – 2016-11-18T16:42:13.457