## Overview

- Automated windows command script to process Microsoft Windows 11/10 Unified Update Platform files, allowing to build/convert them into a usable state (ISO / WIM).
- You can get UUP files by performing upgrade from Windows 11/10 build to a later build (starting 15063, aka version 1703).
- You can also obtain UUP canonical source using one of these projects:
  UUP dump website
  UUP Generation Project

## How To Use

- Administrator privileges are required to run the script.
- Optional: temporary disable AV or protection program so it doesn't interfere with the process.
- Make sure the files are not read-only or blocked.
- Extract this pack to a folder with simple spaceless path to avoid troubles (example: C:\UUP).
- Place the files in "UUPs" folder to be detected automatically, or drag and drop uup files directory on convert-UUP.cmd. Alternatively, you will be prompted to enter other UUP folder path.
- If multiple Editions detected, you will be prompted first to select one edition, some editions, or create AIO.
- To exit of the prompt or options menu just press "Enter".

## Output Choice

- 1 - Create ISO with install.wim
  4 - Create ISO with install.esd
  convert UUP files to a regular ISO distribution that contains install.wim or install.esd file.
- 2 - Create install.wim
  5 - Create install.esd
  create install.wim/install.esd file only, which can be used with other ISO with the same version or for manual apply using dism, imagex, wimlib.
- 3 - UUP Edition info
  Display info about detected editions (architecture, language, build version, build branch, editions name).
- 6 - Configuration Options
  Change the state of configuration options.

## Configuration Options

Control conversion behavior, output and automation.
You have three ways to change the state of these options, where 0 means the option is OFF (no), and 1 means the option is ON (yes):
- edit ConvertConfig.ini under [convert-UUP] and [Store_Apps] sections
- delete ConvertConfig.ini and edit convert-UUP.cmd script directly
- use menu choice 6 (this does not include all options)

- AutoStart
  Start the conversion process directly without prompts.
  This require placing UUP files in UUPs folder, or starting convert-UUP.cmd from command prompt with path to UUP source folder, or drag and drop UUP source folder on convert-UUP.cmd.
  Set this option to 1 to create ISO with install.wim
  Set this option to 2 to create ISO with install.esd
  Set this option to 3 to create install.wim only
  Set this option to 4 to create install.esd only
- AddUpdates
  Update the ISO distribution or install.wim with detected updates after conversion.
  Set this option to 1 to integrate updates into wim files
  Set this option to 2 to add updates externally to ISO distribution
  See Add Updates Option for more details.
- StartVirtual
  Start create_virtual_editions.cmd directly after conversion is completed.
  See Virtual Editions for more details.
- wim2esd
  Convert install.wim to install.esd at the end.
  This option is intended to be used with AddUpdates option.
  This option will be auto enabled if you selected install.esd choice and AddUpdates is ON.
  Warning: creating install.esd will consume high amount of CPU/RAM, and take considerable time to complete.
- wim2swm
  Split install.wim into multiple install.swm files.
  This option will be auto disabled if install.wim size is below 4 GB.
  If both wim2esd/wim2swm are ON, install.esd takes precedence over split install.swm.
- SkipISO
  If you are not interested to create ISO file currently, or want to create Multi-Architecture ISO (x86/x64) later with multi_arch_iso.cmd, or intend to manually use create_virtual_editions.cmd
- SkipWinRE
  Do not add winre.wim to install.wim/install.esd, if you are not interested to have recovery environment or want to reduce ISO size/conversion period.. etc.
  note: adding winre.wim to install.esd will consume high amount of CPU/RAM.
- LCUwinre
  Force updating winre.wim with Cumulative Update even if SafeOS update detected.
  This option is auto enabled for Windows 11 build 22000 and later, Set this option to 2 to disable.
- DisableUpdatingUpgrade
  Disable updating process optimization by using editions upgrade (Home>Pro / ServerStandard>ServerDatacenter), and perform separate updating for each edition.
- UpdtBootFiles
  Update ISO boot files bootmgr/memtest/efisys.bin with new files from Cumulative Update.
  note: to accommodate KB5025885 changes, the two files bootmgr.efi/bootmgfw.efi will be always updated regardless this option.
- ForceDism
  Use the official method with dism.exe for creating boot.wim, which require Windows 11/10 Host OS or ADK.
- RefESD
  Keep converted reference ESD files for future operations instead converting them each time.
  if UUP source is Express, Reference ESDs and Edition ESDs will be copied to new folder "CanonicalUUP", practically, this convert/backup Express UUP source to Canonical.
  if UUP source is Canonical, Reference ESDs will be copied to the same UUP source folder, and original CAB files will be moved to subdirectory "Original".
- SkipLCUmsu
  Skip creating Cumulative Update MSU for builds 21382 to 25330 (LCU will be added using legacy cab+psf extraction).
- SkipEdge
  Set option to 1 : Do not integrate Microsoft Edge Chromium with Feature Update Enablement Package or Cumulative Update.
  Set option to 2 : Skip Microsoft Edge Chromium with Cumulative Update via alternative workaround.
  This option works only with option AddUpdates=1 (Integrate).
- AutoExit
  Exit the conversion process (script) on completion without prompt.
  useful option for multi batch conversions, best used with AutoStart option.
- AddDrivers
  Add drivers to install.wim and boot.wim / winre.wim
  this is basic feature support, and should be used only with tested working compatible drivers.
  * How To Use:
  - enable the option
  - place the drivers you want to add inside the proper subfolder:
  `ALL: drivers will be added to all wim files
  OS: drivers will be added to install.wim only
  WinPE: drivers will be added to boot.wim / winre.wim only`
  * Optionally, you can specify different source folder path for drivers, using option Drv_Source
  the folder must contain subfolder for each drivers target, as explained above.
  * The option will only works alongside integrating Updates or Apps.
  * The option will not check or verify drivers, it simply point DISM towards the drivers folders.
  * The option is ment for simple and boot critical drivers (chipsets, disk controllers, LAN/WiFi..), to allow easier installation, not for large drivers, or drivers that may break setup.
- ### Below options apply only for builds 22563 and later ###
- SkipApps
  Do not add Store Apps.
- AppsLevel
  Control added Apps for Client editions (except Team).
  Set to 0 to add all referenced Apps
  Set to 1 to add Store, Security Health only
  Set to 2 to add level 1 apps + Photos, Camera, Notepad, Paint
  Set to 3 to add level 2 apps + Terminal, App Installer, Widgets
  Set to 4 to add level 3 apps + Media apps (Music, Video, Codecs, Phone Link) / not for N editions
- StubAppsFull
  Control preference for Apps which are available as stubs.
  Set to 0 to install as stub app
  Set to 1 to install as full app
- CustomList
  Enable using CustomAppsList.txt or CustomAppsList2.txt to pick and choose the added Apps.
  If enabled, this option takes precedence over AppsLevel option.
  How to use:
  You can either use CustomAppsList.txt directly, or copy/rename it to CustomAppsList2.txt
  Edit the choosen file, and remove # prefix in front the Apps you wish to add, and save the file.

## Add Updates Option

### Info

- Starting Windows 10 version 1709, Servicing Stack Update and Latest Cumulative Update are handled and distributed with UUP source. In addition to some small dynamic updates used in upgrades.
- According to that, UUP Dump will offer multiple builds for the same Windows 11/10 version. Each one will represent refreshed Feature Update or new Cumulative Update.
- However, those updates are only used and applied by Windows Update, they not actual part of the UUP source itself and will not be included in the converted ISO/WIM by default.
- AddUpdates option provide built-in ability to directly integrate these updates, resulting a refreshed ISO/WIM, or to add them externally.
- Integrate updates mode only works with install.wim (ISO or Single), and require Windows 11/10 Host OS or Windows 11/10 ADK.
- External updates mode only works with builds 17763 and later, and the updates will be installed during setup (clean install or upgrade).
- Cleanup option control image cleanup for integration mode, and will delta-compress superseded components.
- ResetBase option works only with Cleanup option, and will further remove superseded components.
- NetFx3 option is to enable .NET 3.5 feature for both modes.
- External updates mode is ment as backup procedure in case Windows 11/10 ADK is not installed, or the user want to have converted ISO faster. It is recommended to use the normal integration mode if possible.
- If UUP source is build 17063 or later and multiple editions are selected, in order to reduce integration mode time, Pro/ProN editions will be created as upgrades from the already updated Home/HomeN editions, if possible.
- Similarly, for Windows Server 2022, Datacenter editions will be created as upgrades from the already updated Standard editions, if possible.
- Integrate updates mode may not work correctly on Windows 7 Host OS, specially with recent Windows 11/10 builds. External updates mode is recommended to use in that case.
- Integrate updates mode for ARM64 UUP images only works on Windows 11/10/8.1 Host OS.
- Integrate updates mode for Windows 11 builds 22567 and later require at least Windows 10 v1607 Host OS.

### How To

- Make sure UUP source contain updates (Windows10.0-KB* / Windows11.0-KB* files)
- Set configuraation option AddUpdates to 1 or 2
- If you set to 1 and Windows 11/10 ADK is not installed, it will be reverted to 2 (if build is supported), or turned OFF

### Note

Warning: on build 18362 and later, Cleanup option will also removes the base RTM Edition packages, due Cumulative Update design change by Microsoft.
This could cause future cumulative updates to fail installation.
Nevertheless, system itself can initiate the cleanup process after installation, either with schedule tasks StartComponentCleanup or SilentCleanup, or via Disk Cleanup.
Warning: ResetBase option break "Reset This PC" feature. Full ResetBase is automatically disabled for build 18362 and later.

## Virtual Editions

### Info

- Starting Windows 10 build 17063, regular editions have been unified into two base editions: Home & Pro (with their variants Home N & Pro N)
  Home China edition is still separate
- According to that, UUP will deliver installation files for the above editions only
- The following editions now exist as "virtual upgrade editions" with base editions:
  `Home -> Home Single Language
  Pro -> Enterprise, Education, Pro Education, Pro for Workstations, Cloud (builds 21364+), Enterprise multi-session, IoT Enterprise (builds 18277+), IoT Enterprise Subscription (builds 25982+)
  Pro N -> Enterprise N, Education N, Pro Education N, Pro N for Workstations, Cloud N (builds 21364+)
  Enterprise LTSC -> IoT Enterprise LTSC (builds 19041+), IoT Enterprise LTSC Subscription (builds 25193+)`
- Therefore, the extra script is to help create these additional editions from UUP source.

### How To

- Supported source distribution:
  - Folder (containing the extracted ISO) placed next to the script. (auto detected)
  - DVD Drive, i.e. mounted iso/real dvd drive/usb drive. (auto detected)
  - Direct ISO file. (you will prompted to specify one)
- Optional: if you do not intend to keep base converted ISO, set convert-UUP option SkipISO to 1.
- Use convert-UUP.cmd to create the source distribution.
- Run create_virtual_editions.cmd and choose the desired option from choices.

### Options

- 1 - Create all editions
  create all possible target virtual editions.
- 2 - Create one edition
  create one of the target virtual editions.
- 3 - Create randomly selected editions
  create some of the target virtual editions.

### Config Options

Control process behavior, output and automation.
You have two ways to change the state of these options, where 0 means the option is OFF (no), and 1 means the option is ON (yes):
- edit ConvertConfig.ini under [create_virtual_editions] section
- delete ConvertConfig.ini and edit create_virtual_editions.cmd script directly

- UseDism
  Choose the creation method:
  Value 0 : Registry manipulation
  hacky way, work with install.wim or install.esd, support any host OS (Vista+).
  Value 1 : Dism.exe tool
  official way, work with install.wim, require NT 10.0 host OS or Windows 8.1 with Windows ADK.
  Value 2 : Force Dism.exe tool
  Same as value 1, but work on Windows 7/8 with Windows ADK.
  If chosen value is 1 or 2 and host OS is NT 6.x without Windows ADK installed, it will be auto reverted to value 0
  If chosen value is 1 or 2 and source file is install.esd, it will be auto reverted to value 0
- AutoStart
  Start the creation process directly without prompts.
  This require the source distribution to be ready (folder or drive).
  Only the editions specified in AutoEditions will be created, if no edition specified (empty), it will create all possible target editions.
- AutoEditions
  Specify editions to auto create with AutoStart option, separate the editions with a comma ,
  Leave this option empty to create all possible target editions.
  Supported editions values:
  Enterprise, Education, ProfessionalEducation, ProfessionalWorkstation, CloudEdition, ServerRdsh, IoTEnterprise, IoTEnterpriseK
  EnterpriseN, EducationN, ProfessionalEducationN, ProfessionalWorkstationN, CloudEditionN
  CoreSingleLanguage
  IoTEnterpriseS, IoTEnterpriseSK
  Examples:
  `vAutoEditions=Enterprise
  vAutoEditions=Enterprise,ProfessionalWorkstation,Education
  vAutoEditions=`
- DeleteSource
  Do not keep the source editions (example: create Enterprise and delete Pro).
- Preserve
  Preserve and keep source distribution folder intact, the operation will be done on copied folder instead.
  If source distribution is ISO file, this option has no affect.
- wim2esd
  Convert install.wim to install.esd at the end.
  Warning: creating install.esd will consume high amount of CPU/RAM, and might take considerable time to complete.
- SkipISO
  Do not create final ISO file at the end.

Note:
If create_virtual_editions.cmd is started from convert-UUP.cmd, options AutoStart & wim2esd & SkipISO will be inherited from convert-UUP section, regardless their current state under create_virtual_editions section
meaning, the script will auto-create virtual editions if convert-UUP's AutoStart=1
and install.wim will be converted to install.esd if convert-UUP's wim2esd=1, otherwise skip conversion if convert-UUP's wim2esd=0

## Multi-Architecture ISO (x86/x64)

### How To

- Optional: if you do not intend to keep single architecture ISOs, edit convert-UUP.cmd and set SkipISO=1
- Use convert-UUP.cmd to create two ISO distributions, one for x64 and another for x86, you may select the desired editions to include in each one
- Run multi_arch_iso.cmd and choose the desired option from menu

### Options

- 1 - Create ISO with 1 combined install.wim/install.esd
  create a custom ISO structure.
  with 1 install.wim/install.esd for all x64/x86 images, and slighlty modified bootx64.wim/bootx86.wim to allow coexistence.
- 2 - Create ISO with 2 separate install.wim/install.esd (Win 10)
  create the same ISO structure as Media Creation Tool.
  with 2 separate x64/x86 folders and install.wim/install.esd for each architecture.

### Notes

- To preserve source single-architecture distributions folders, edit multi_arch_iso.cmd and set Preserve=1
- If the installation file is install.esd, be aware that option 1 will require high amount of CPU/RAM to unify install.esd files
- multi_arch_iso.cmd can be used also to create multi-architecture ISO from any similar Windows x64/x86 ISO distributions, starting Windows 7 SP1
  however, option 2 only works with Windows 11/10 setup files.

## Debug Mode

Intended to help into detecting errors in the script or the conversion process and create a full log of the operation.
To enable debug mode, follow these steps:

- set the desired configuration options in ConvertConfig.ini (specially AutoStart).
- edit convert-UUP.cmd and change set _Debug=0 to set _Debug=1 and save the changes.
- to start the process: put the UUP files in UUPs folder, then run the script as administrator.
- another way to start the process: drag and drop the UUP files source directory on convert-UUP.cmd
- wait until the process finish and cmd window is closed.

Note: create_virtual_editions.cmd will inherit debug mode if StartVirtual option is active.

## Extra Notes

- If the conversion or updating process failed and you got "access denied" errors, run Remove_Failure_MountDir_TempDir.cmd as administrator to remove temporary mount directory and extraction leftovers.
- If the upgrade is done via Express UUP (multiple expanded folders in the download directory), you need to perform the UUP > ISO operation before starting the upgrade process (before first restart).
  to do so, when WU prompt you to restart, start convert-UUP.cmd and paste the path to download directory, example:
  - C:\Windows\SoftwareDistribution\Download\07172dda91861218ecc095600216d792
  Alternatively, if you are testing in VM machine or have multi boot systems, you can choose to Shut down/Restart the system without upgrading.
  on Desktop, press Alt+F4 and choose an option without Update

## Credits

- whatever127 - UUP dump
- Eric Biggers - wimlib
- Igor Pavlov - 7-zip
- Melinda Bellemore - SxSExpand
- BetaWorld - PSFExtractor
- Jeff Kluge - Managed DismApi Wrapper
- erwan.l - offlinereg
- cdob - create aio efisys.bin
- Special thanks to: @rgadguard, @Enthousiast, @Windows_Addict, @s1ave77, @Ratiborus58, @NecrosoftCore, @DiamondMonday, @WzorNET
- cabarc, cdimage, imagex and bcdedit are intellectual property of Microsoft Corporation.

Author: abbodi1406