Tutorial and scripts to help with the preparation and creation of and installation using a custom Windows 10 image.
Much of the first part is adapted from this blogpost by James Rankin [Archived link].
The second part is adapted from this post on the TenForums [Archived link] from point 5.3) onwards.
- A PC with a clean installation of windows, with no user set up yet (asking which region you're in).
- A standard bootable Windows installation USB stick with a copy of all the files from here in a subfolder on it, plugged into the PC.
- An additional copy of the
winre.wim
file found in the default installation or got through this method in theScriptFiles
folder.
- In the region choice screen, press
Ctrl+Shift+F3
.
The PC reboots into Audit Mode and gives you a temporary account to work with. - Close the System Preparation Tool window.
- Configure windows settings according to your needs and wants.
- Uninstall and disable unwanted UWPs (Windows 10 default Apps) [Archived link]
- Open PowerShell as Administrator (
Ctrl+Shift
). - Run
Get-AppxProvisionedPackage -online | Out-GridView -PassThru | Remove-AppxProvisionedPackage -online
. - Select all Apps you don't want (Ctrl+Click) and click ok. Wait for it running.
- Run
Get-AppxPackage -AllUsers | Out-GridView -PassThru | Remove-AppxPackage
. - Select all Apps you don't want (Ctrl+Click) and click ok. Wait for it running. If there are errors ignore them.
- Go the normal program list and uninstall any additional unwanted programs (e.g. OneDrive).
- Open PowerShell as Administrator (
- Install programs to provide by default (e.g. Firefox, MS Office, ...).
- Configure these programs' settings (e.g. config and install Addons in Firefox) and make them default for their filetypes if wanted.
- If a program you're using saves it's settings in
AppData
, add the corresponding folder/file in theEmptyDefault.cmd
fromScriptFiles
.
- If a program you're using saves it's settings in
- Run
0.1_CreateDefaultAssociations.cmd
. - Run
0.2_CreateDefaultStartMenuLayout.ps1
.- If that doesn't work, run
Export-StartLayout -Path C:\LayoutModification.xml
in an elevated PowerShell.
- If that doesn't work, run
- Open
C:\defaultassociations.xml
and edit it according to the wanted default file associations. (An example is provided inScriptFiles
.) - Open
C:\LayoutModification.xml
and add the Taskbar Layout as needed [Archived link].- An example is provided in
ScriptFiles
.
- An example is provided in
- Cut & paste your modified XMLs from 8. & 9. into the
ScriptFiles
folder, replacing my default ones. - Run
1_Preparations.cmd
elevated. - Run the partition manager.
- Shrink your main partition by 15-25 GB.
- Create a new partition with this space called
Install
. - Run
2_Sysprep.cmd
elevated and wait for the system to shut down. - Start your system from the USB stick.
- In the installation screen, press
Shift+F10
to open the command prompt. - Use
E:
(probably, orD:
if you don't have an optical drive) to change to your stick andcd
to the directory the.cmd
files are located in. - Run
3_CreateImage.cmd
(from the command line). This will take a while (> 20 min probably, so go make yourself a coffee or whatever). - Close command line and installation window and reboot your system normally.
- Go through the first user creation process until you reach the desktop.
- Open the USB stick and run
4_SplitImage.cmd
. This will again take a short while (> 5 min probably). - Open the
sources
folder on your USB stick and deleteinstall.wim
from it. - Open the Install partition in file explorer.
- Copy all
.swm
files (not the.wim
file) into the sources dir of your stick. - Use the partition manager to delete the Install partition and reclaim it's space for your main partition.
- You now have a stick with an installer for a customized Windows.
(You can skip this if you are happy with the USB stick.)
- Temporarily move the folder containing the scripts from your USB stick to somewhere else (e.g. the Desktop).
- Download the Windows Assessment and Deployment Kit (ADK).
- Install only the Deployment Tools. (You don't need anything else.)
- Open the (newly installed) Deployment and Imaging Tools elevated.
- Run command
cd\
. - Run
oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,bE:\boot\etfsboot.com#pEF,e,bE:\efi\microsoft\boot\efisys.bin E: C:\CustomWin10.iso
.
ReplaceE:
with the drive letter of your USB stick andC:\CustomWin10.iso
with the path and name of the ISO file you want.
This will again take a short while. - The image was created at the specified path. Renaming the file is possible without any special care.
- Move the folder with scripts back onto your USB stick.
Because of the split image and the nature of custom installations, a few things are different from a normal installation.
- Plug in your USB stick from above into a new PC.
- Boot from the USB stick.
- In the installation screen, press
Shift+F10
to open the command prompt. - Use
D:
(probably now) to change to your USB stick andcd
to the directory the.cmd
files are located in. - Run
A_StartInstallation.cmd
. This will take a while (> 15 min probably, go get a second refreshment if you like). - Close command line and installation window and reboot your system normally.
- Got through the first user creation process until you reach the desktop.
- Important! Run
B_FixDefault.cmd
elevated.
If you don't do this step, new logins will take ages and won't work correctly the first few times.
If you forget this step, you can runX_EmergencyFixDefault.cmd
elevated on any user to fix it for future users.