Is this as simple as adding a desktop shortcut to folders containing the setup/install file?
No, as WinPE is a self-contained boot WIM [Windows IMage] containing WinPE OCs [Optional Components]:
WinPE-Setup is required for Windows Setup, which has seven configuration passes:
- Upon selecting Install:
windowsPE
- Setup boots to WinPE:
offlineServicing
- Setup boots to Windows:
specialize, auditSystem, auditUser, oobeSystem
Where can I find information on modifying a WinPE.wim and rebuilding it?
Microsoft Docs, with two routes for customizing a WinPE.wim/WinRE.wim:
- Build your own:
- Recommended over customizing an existing custom WIM, as it's more storage efficient and doesn't add a significant amount of time to customization
- Create one using WinPESE, which creates a normal Windows GUI within WinPE:
- Cons: the
WinPE.wim/WinRE.wim balloons from ~320MB to ~1.5GB+ and the larger the WIM, the longer it takes to boot it, as all data within the WIM has to be mounted [extracted] to a virtual partition [X:]
- Pros: Offers a whole host of advanced troubleshooting tools and, if regularly capturing WIMs of the
C: partition, allows for basic work to still be done while booted to WinPE
PreReqs:
- Install Windows ADK and WinPE files:
- ADK (Win7: AIK) for the version of Windows installed
(Setup: Windows Preinstallation Environment)
- ≥ v1809: Windows PE Add-On is separate (ADK still required)
- Update the system
PATH:
+R → SysDm.cpl → OK
- Advanced → Environment Variables... → System variables →
Path → Edit → New:
# Update paths accordingly if not using Win10 or an x64 OS version:
C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools
C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\BCDBoot
C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM
C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg
C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment
- OK → OK → OK
- Open an Admin terminal:
+R → powershell → Ctrl+Shift+OK
Build WinPE Filesystem
Required:
- Mount WinPE boot image:
# Load ADK variables:
Cmd /K "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat"
# Copy WinPE files to working directory C:\WinPE:
CopyPE amd64 "C:\WinPE"
# Mount WinPE WIM:
Dism /Mount-Image /ImageFile:"C:\WinPE\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE\mount"
- Add WinPE Optional Components:
# Create OCs directory link in working directory C:\WinPE:
MkLink /J "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs" "C:\WinPE\OCs"
# Add OCs: (OC and language CABs required for each OC)
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\<name>.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\<name>_en-us.cab"
The following are the minimum I recommend:
(dependencies exist, add in the order listed)
- Set WinPE default temp space to 512MB: (default: 32MB)
Dism /Set-ScratchSpace:512 /Image:"C:\WinPE\mount"
- Optional - Add custom:
- Drivers: (Network drivers)
Dism /Add-Driver /Image:"C:\WinPE\mount" /Driver:"C:\Path\to\driver.inf"
- Files/directories: Copy to
C:\WinPE\mount
- Startup scripts to:
C:\WinPE\mount\Windows\System32\Startnet.cmd
- Startup apps (such as QDir) to:
C:\WinPE\mount\Windows\System32\Winpeshl.ini
- Background:
- Change permissions of
C:\WinPE\mount\Windows\System32\winpe.jpg:
# Change ownership to the Administrators group:
TakeOwn /A /F "C:\WinPE\mount\Windows\System32\winpe.jpg"
# Give Administrators group Full permissions:
Icacls "C:\WinPE\mount\Windows\System32\winpe.jpg" /SetOwner Administrators
- Replace
winpe.jpg with a custom .jpg
- Power Scheme: set to Performance by adding to
C:\WinPE\mount\Windows\System32\startnet.cmd:
powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
- If needed, apply any
.msu updates to WinPE from the Microsoft Update Catalog:
# Add update package:
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\windows10.0-kbxxxxx.msu"
# Lock in the update:
Dism /Cleanup-Image /Image:"C:\WinPE\mount\Windows" /StartComponentCleanup /ResetBase
- Commit changes, unmount, and export image:
# Optimize:
Dism /Cleanup-Image /Image:"C:\WinPE\mount" /StartComponentCleanup /ResetBase
# Unmount:
Dism /Unmount-Image /MountDir:"C:\WinPE\mount" /Commit
# Export:
Dism /Export-Image /SourceImageFile:"C:\WinPE\media\sources\boot.wim" /SourceIndex:1 /DestinationImageFile:"C:\WinPE\WinPE_Custom.wim" /DestinationName:"Customized WinPE & Includes: QDir, Show Hidden Files" /Compress:Max /Bootable /CheckIntegrity
# Replace original:
Del "C:\WinPE\media\sources\boot.wim"
Copy "C:\WinPE\WinPE_Custom.wim" "C:\WinPE\media\sources\boot.wim"
- Create WinPE boot media via
MakeWinPEMedia: