Docsity

Código prueba de UUP dump, Transcripciones de Complejidad Computacional Avanzada

Toggle sidebar
bg1
<!-- : Begin batch script
@setlocal DisableDelayedExpansion
@set uivr=v125r
@echo off
:: Change to 1 to enable debug mode
set _Debug=0
:: ### Auto processing option ###
:: 1 - create ISO with install.wim
:: 2 - create ISO with install.esd
:: 3 - create install.wim only
:: 4 - create install.esd only
set AutoStart=0
:: Change to 1 to integrate updates (if detected) into install.wim/winre.wim
:: Change to 2 to add updates externally to iso distribution
set AddUpdates=0
:: Change to 1 to cleanup images to delta-compress superseded components (Warning: on 18362 and later, this removes the
base RTM Edition packages)
set Cleanup=0
:: Change to 1 to rebase image and remove superseded components (faster than default delta-compress)
:: require first to set Cleanup=1
:: change to 2 to run rebase after each LCU for builds 26052 and later
set ResetBase=0
:: Change to 1 to enable .NET 3.5 feature with updates
set NetFx3=0
:: Change to 1 to start create_virtual_editions.cmd directly after conversion
set StartVirtual=0
:: Change to 1 to convert install.wim to install.esd
set wim2esd=0
:: Change to 1 to split install.wim into multiple install.swm
:: note: if both options are 1, install.esd takes precedence
set wim2swm=0
:: Change to 1 for not creating ISO file, result distribution folder will be kept
set SkipISO=0
:: Change to 1 for not adding winre.wim into install.wim/install.esd
set SkipWinRE=0
:: Change to 1 to force updating winre.wim with Cumulative Update regardless if SafeOS update detected
:: ignored and auto disabled for builds 26052 and later
set LCUwinre=0
:: Change to 1 to expand Cumulative Update and install from loose files via update.mum
:: applicable only for builds 22621 and later
:: auto enabled for builds 26052 and later, change to 2 to disable
set LCUmsuExpand=0
:: Change to 1 to disable updating process optimization by using editions upgrade (Home>Pro /
ServerStandard>ServerDatacenter)
:: auto enabled for builds 26000 and later, change to 2 to disable
set DisableUpdatingUpgrade=0
:: Change to 1 to update ISO boot files bootmgr/memtest/efisys.bin from Cumulative Update
:: this also update new UEFI CA 2023 boot files if detected
set UpdtBootFiles=0
:: Change to 1 to use dism.exe for creating boot.wim
set ForceDism=0
:: Change to 1 to keep converted Reference ESDs
set RefESD=0
:: Change to 1 to skip creating Cumulative Update MSU for builds 21382 - 25330
set SkipLCUmsu=0
:: Change to 1 for not integrating EdgeChromium with Enablement Package or Cumulative Update
:: Change to 2 for alternative workaround to avoid EdgeChromium with Cumulative Update only
set SkipEdge=0
:: Change to 1 to exit the process on completion without prompt
set AutoExit=0
:: ### Drivers Options ###
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Vista previa parcial del texto

¡Descarga Código prueba de UUP dump y más Transcripciones en PDF de Complejidad Computacional Avanzada solo en Docsity!

:: Change to 1 to add drivers to install.wim and boot.wim / winre.wim set AddDrivers=

:: custom folder path for drivers - default is "Drivers" folder next to the script :: the folder must contain subfolder for each drivers target: :: 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 set "Drv_Source=\Drivers"

:: ### Store Apps for builds 22563 and later ###

:: Change to 1 for not integrating store apps into install.wim set SkipApps=

:: # Control added Apps for Client editions (except Team) :: 0 / all referenced Apps :: 1 / only Store, Security Health, App Installer, StartExperiencesApp :: 2 / level 1 + Photos, Camera, Notepad, Paint :: 3 / level 2 + Terminal, Widgets, Mail / Outlook, Clipchamp :: 4 / level 3 + Media apps (Music, Video, Codecs, Phone Link) / not for N editions set AppsLevel=

:: # Control preference for Apps which are available as stubs :: 0 / install as stub app :: 1 / install as full app set StubAppsFull=

:: Enable using CustomAppsList.txt or CustomAppsList2.txt to pick and choose added Apps (takes precedence over AppsLevel) :: CustomAppsList2.txt will be used if detected set CustomList=

:: ###################################################################

set DeleteSource= set "SortEditions="

set "_Null=1>nul 2>nul" set DisableRebuildWim= set "_wrb=" if %DisableRebuildWim% equ 1 set "_wrb=rem."

set _UUP= set qerel= set _elev= set "_args=" set "_args=%~1" if not defined _args goto :NoProgArgs if "%~1"=="" set "_args="&goto :NoProgArgs set "_args=" for %%# in (%*) do ( if /i "%%~#"=="-elevated" (set _elev= ) else if /i "%%~#"=="-qedit" (set qerel= ) else (set "_args=%%~#") )

:NoProgArgs @color 07 set "xOS=amd64" if /i "%PROCESSOR_ARCHITECTURE%"=="arm64" set "xOS=arm64" if /i "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" set "xOS=x86" if /i "%PROCESSOR_ARCHITEW6432%"=="amd64" set "xOS=amd64" if /i "%PROCESSOR_ARCHITEW6432%"=="arm64" set "xOS=arm64" set "xDS=bin\bin64;bin;temp" if /i not %xOS%==amd64 set "xDS=bin;temp" set "SysPath=%SystemRoot%\System32" set "Path=%xDS%;%SysPath%;%SystemRoot%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0" if exist "%SystemRoot%\Sysnative\reg.exe" ( set "SysPath=%SystemRoot%\Sysnative" set "Path=%xDS%;%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1. 0;%Path%" ) set "_err=echo: &echo ==== ERROR ====" set "_psc=powershell -nop -c" set winbuild= for /f "tokens=6 delims=[]. " %%# in ('ver') do set winbuild=%%# set _cwmi= for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (

set "_Exit=echo Press any key to exit." set "_Supp=" goto :Begin ) set "_Nul1=" set "_Nul2=" set "_Nul6=" set "_Nul3=" set "_Pause=rem." set "_Contn=rem." set "_Exit=rem." set "_Supp=1>nul" copy /y nul "!_work!#.rw" %_Null% && (if exist "!_work!#.rw" del /f /q "!_work!#.rw") || (set "_log=!_dsk!%~n0") echo. echo Running in Debug Mode... echo The window will be closed when finished @echo on @prompt $G @call :Begin >"!_log!_tmp.log" 2>&1 &cmd /u /c type "!_log!_tmp.log">"!_log!_Debug.log"&del /f /q "!_log!_tmp.log" @color 07 @title %ComSpec% @exit /b

:Begin title UUP -^> ISO %uivr% set "_dLog=%SystemRoot%\Logs\DISM" call :checkadk set W10UI= if %winbuild% geq 10240 ( set W10UI= ) else ( if %_ADK% equ 1 set W10UI= ) call :postVars if defined _UUP goto :check if %_Debug% neq 0 goto :check setlocal DisableDelayedExpansion

:prompt @cls set _UUP= echo. echo Enter the path to UUP source directory echo %_ln1% echo. set /p _UUP= if not defined _UUP set _Debug=1&goto :QUIT set "_UUP=%_UUP:"=%" if "%_UUP:~-1%"=="" set "_UUP=%_UUP:~0,-1%" if not exist "%_UUP%*.esd" ( %_err% echo Specified path is not a valid UUP source echo. %_Contn%&%_Pause% goto :prompt ) setlocal EnableDelayedExpansion

:check if %_Debug% neq 0 ( if defined _args echo "!_args!" echo "!_work!" ) pushd "!_work!" set _fils=(7z.dll,7z.exe,bcdedit.exe,bfi.exe,bootmui.txt,bootwim.txt,cdimage.exe,imagex.exe,libwim-15.dll,offlinereg.exe,off reg.dll,wimlib-imagex.exe,PSFExtractor.exe,cabarc.exe) for %%# in %_fils% do ( if not exist ".\bin%%#" (set _bin=%%#&goto :E_Bin) ) if not defined _UUP ( (echo.&echo UUP source directory is not specified, or valid)>>"!logerr!" exit /b ) if not exist "ConvertConfig.ini" goto :proceed findstr /i [convert-UUP] ConvertConfig.ini %_Nul1% || goto :proceed for %%# in ( AutoStart AddUpdates Cleanup ResetBase

NetFx StartVirtual SkipISO SkipWinRE LCUwinre LCUmsuExpand DisableUpdatingUpgrade UpdtBootFiles wim2esd wim2swm ForceDism RefESD SkipLCUmsu SkipEdge AutoExit AddDrivers Drv_Source SkipApps AppsLevel StubAppsFull CustomList ) do ( call :ReadINI %%# ) findstr /b /i vDeleteSource ConvertConfig.ini %_Nul1% && for /f "tokens=2 delims==" %%# in ('findstr /b /i vDeleteSource ConvertConfig.ini') do set "DeleteSource=%%#" findstr /b /i vSortEditions ConvertConfig.ini %_Nul1% && for /f "tokens=1* delims==" %%A in ('findstr /b /i vSortEditions ConvertConfig.ini') do set "SortEditions=%%B" goto :proceed

:ReadINI findstr /b /i %1 ConvertConfig.ini %_Nul1% && for /f "tokens=2 delims==" %%# in ('findstr /b /i %1 ConvertConfig.ini') do set "%1=%%#" goto :eof

:proceed :: @color 1F echo. echo === Detecting UUP editions files... echo. if %_Debug% neq 0 ( if %AutoStart% equ 0 set AutoStart= ) set _configured= set u_msulcu=%LCUmsuExpand% set u_winre=%LCUwinre% set u_upgrade=%DisableUpdatingUpgrade% if exist bin\temp\ rmdir /s /q bin\temp if exist temp\ rmdir /s /q temp if exist bin\expand.exe if not exist bin\dpx.dll del /f /q bin\expand.exe mkdir bin\temp mkdir temp set _updexist= if exist "!_UUP!*Windows1-KB.msu" set _updexist= if exist "!_UUP!*Windows1-KB.cab" set _updexist= if exist "!_UUP!\SSU--.cab" set _updexist= set _pmcppc= if exist "!_UUP!*Microsoft-Windows-Printing-PMCPPC-FoD-Package.cab" set _pmcppc= if exist "!_UUP!*Microsoft-Windows-Printing-PMCPPC-FoD-Package.esd" set _pmcppc= dir /b /ad "!_UUP!*Package" %_Nul3% && set EXPRESS= for %%# in ( Core,CoreN,CoreSingleLanguage,CoreCountrySpecific Professional,ProfessionalN,ProfessionalEducation,ProfessionalEducationN,ProfessionalWorkstation,ProfessionalWorkstationN Education,EducationN,Enterprise,EnterpriseN,EnterpriseG,EnterpriseGN,EnterpriseS,EnterpriseSN,ServerRdsh PPIPro,IoTEnterprise,IoTEnterpriseK,IoTEnterpriseS,IoTEnterpriseSK Cloud,CloudN,CloudE,CloudEN,CloudEdition,CloudEditionN,CloudEditionL,CloudEditionLN Starter,StarterN,ProfessionalCountrySpecific,ProfessionalSingleLanguage ServerStandardCore,ServerStandard,ServerDatacenterCore,ServerDatacenter,ServerTurbineCore,ServerTurbine,ServerAzureStack HCICor WNC ) do ( if exist "!UUP!%%#.esd" (dir /b /a:-d "!UUP!%%#.esd">>temp\uups_esd.txt %Nul2%) else if exist "!UUP!\MetadataESD%%#.esd" (dir /b /a:-d "!UUP!\MetadataESD%%#_*.esd">>temp\uups_esd.txt %_Nul2%) ) for /f "tokens=3 delims=: " %%# in ('find /v /c "" temp\uups_esd.txt %_Nul6%') do set uups_esd_num=%%# if %uups_esd_num% equ 0 goto :E_ESD for /L %%# in (1,1,%uups_esd_num%) do call :uups_esd %%# if defined eWIMLIB goto :QUIT if %uups_esd_num% gtr 1 goto :MULTIMENU set "MetadataESD=!_UUP!%uups_esd1%"&set "_flg=%edition1%"&set "arch=%arch1%"&set "langid=%langid1%"&set "editionid=%edition1%"&set "_oName=%_oname1%"&set "_Srvr=%_ESDSrv1%"

if %userinp% equ 0 (set _Debug=1&goto :QUIT) if %userinp% equ 6 goto :CONFMENU if %userinp% equ 5 if %EXPRESS% equ 0 (set WIMFILE=install.esd&goto :Single) if %userinp% equ 4 if %EXPRESS% equ 0 (set WIMFILE=install.esd&goto :ISO) if %userinp% equ 3 goto :INFO%_ta2% if %userinp% equ 2 (set WIMFILE=install.wim&set wim2esd=0&goto :Single) if %userinp% equ 1 (set WIMFILE=install.wim&set wim2esd=0&goto :ISO) goto :MAINMENU

:CONFMENU @cls set userinp= set _optStub=No set _optList=No if %StubAppsFull% neq 0 set _optStub=Yes if %CustomList% neq 0 set _optList=Yes echo %_ln2% echo. echo. 0 - Return to Main Menu if %_updexist% equ 1 if %W10UI% equ 0 ( if %AddUpdates% equ 2 (echo. 1 - AddUpdates : Yes {External}) else if %AddUpdates% equ 1 (echo. 1 - AddUpdates : No {ADK missing}) else (echo. 1 - AddUpdates : No) ) if %_updexist% equ 1 if %W10UI% neq 0 ( if %AddUpdates% equ 2 (echo. 1 - AddUpdates : Yes {External}) else if %AddUpdates% equ 1 (echo. 1 - AddUpdates : Yes {Integrate}) else (echo. 1 - AddUpdates : No) if %AddUpdates% equ 1 ( if %Cleanup% equ 0 (echo. 2 - Cleanup : No) else (if %ResetBase% equ 0 (echo. 2 - Cleanup : Yes {ResetBase : No}) else (echo. 2 - Cleanup : Yes {ResetBase : Yes {%ResetBase%}})) ) if %AddUpdates% neq 0 ( if %NetFx3% neq 0 (echo. 3 - NetFx3 : Yes) else (echo. 3 - NetFx3 : No) ) ) if %StartVirtual% neq 0 (echo. 4 - StartVirtual : Yes) else (echo. 4 - StartVirtual : No) if %wim2esd% neq 0 (echo. 5 - WIM2ESD : Yes) else (if %wim2swm% neq 0 (echo. 5 - WIM2SWM : Yes) else (echo. 5

  • WIM2ESD/SWM : No)) if %SkipISO% neq 0 (echo. 6 - SkipISO : Yes) else (echo. 6 - SkipISO : No) if %SkipWinRE% neq 0 (echo. 7 - SkipWinRE : Yes) else (echo. 7 - SkipWinRE : No) if %W10UI% neq 0 ( if %ForceDism% neq 0 (echo. 8 - ForceDism : Yes) else (echo. 8 - ForceDism : No) ) if %RefESD% neq 0 (echo. 9 - RefESD : Yes) else (echo. 9 - RefESD : No) if %W10UI% neq 0 ( if %DisableUpdatingUpgrade% neq 0 (echo. U - DisableUpdatingUpgrade : Yes) else (echo. U - DisableUpdatingUpgrade : No) ) if %_updexist% equ 1 if %W10UI% neq 0 ( if %AddUpdates% equ 1 ( if %LCUwinre% equ 1 (echo. R - LCUwinre : Yes) else (echo. R - LCUwinre : No {%LCUwinre%}) if %UpdtBootFiles% equ 1 (echo. B - UpdtBootFiles: Yes) else (echo. B - UpdtBootFiles: No) if %SkipEdge% neq 0 (echo. E - SkipEdge : Yes {%SkipEdge%}) else (echo. E - SkipEdge : No) ) ) if %SkipLCUmsu% neq 0 (echo. M - SkipLCUmsu : Yes) else (echo. M - SkipLCUmsu : No) if %W10UI% neq 0 ( if %AddDrivers% neq 0 (echo. D - AddDrivers : Yes) else (echo. D - AddDrivers : No) echo. if %SkipApps% neq 0 (echo. A - SkipApps : Yes) else (echo. A - SkipApps : No) ) if %W10UI% neq 0 if %SkipApps% equ 0 ( echo. S - StubAppsFull : %_optStub% # C - CustomList: %_optList% # L - AppsLevel: %AppsLevel% ) echo %_ln1% echo. set /p userinp= ^> Enter your option and press "Enter": if not defined userinp goto :MAINMENU set userinp=%userinp:~0,1% if %userinp%==0 goto :MAINMENU if /i %userinp%==U (if %W10UI% neq 0 (if %DisableUpdatingUpgrade% equ 0 (set DisableUpdatingUpgrade=1) else (set DisableUpdatingUpgrade=0)))&goto :CONFMENU if /i %userinp%==L (if %W10UI% neq 0 if %SkipApps% equ 0 (if %AppsLevel% equ 0 (set AppsLevel=1) else if %AppsLevel% equ 1 (set AppsLevel=2) else if %AppsLevel% equ 2 (set AppsLevel=3) else if %AppsLevel% equ 3 (set AppsLevel=4) else (set AppsLevel=0)))&goto :CONFMENU if /i %userinp%==C (if %W10UI% neq 0 if %SkipApps% equ 0 (if %CustomList% equ 0 (set CustomList=1) else (set CustomList=0)))&goto :CONFMENU if /i %userinp%==S (if %W10UI% neq 0 if %SkipApps% equ 0 (if %StubAppsFull% equ 0 (set StubAppsFull=1) else (set StubAppsFull=0)))&goto :CONFMENU if /i %userinp%==A (if %W10UI% neq 0 (if %SkipApps% equ 0 (set SkipApps=1) else (set SkipApps=0)))&goto :CONFMENU if /i %userinp%==D (if %W10UI% neq 0 (if %AddDrivers% equ 0 (set AddDrivers=1) else (set AddDrivers=0)))&goto :CONFMENU if /i %userinp%==M (if %SkipLCUmsu% equ 0 (set SkipLCUmsu=1) else (set SkipLCUmsu=0))&goto :CONFMENU

if /i %userinp%==E (if %AddUpdates% equ 1 (if %SkipEdge% equ 0 (set SkipEdge=1) else if %SkipEdge% equ 1 (set SkipEdge=2) else (set SkipEdge=0)))&goto :CONFMENU if /i %userinp%==B (if %AddUpdates% equ 1 (if %UpdtBootFiles% equ 0 (set UpdtBootFiles=1) else (set UpdtBootFiles=0)))&goto :CONFMENU if /i %userinp%==R (if %AddUpdates% equ 1 (if %LCUwinre% equ 0 (set LCUwinre=1) else if %LCUwinre% equ 1 (set LCUwinre=2) else (set LCUwinre=0)))&goto :CONFMENU if %userinp%==9 (if %RefESD% equ 0 (set RefESD=1) else (set RefESD=0))&goto :CONFMENU if %userinp%==8 (if %W10UI% neq 0 (if %ForceDism% equ 0 (set ForceDism=1) else (set ForceDism=0)))&goto :CONFMENU if %userinp%==7 (if %SkipWinRE% equ 0 (set SkipWinRE=1) else (set SkipWinRE=0))&goto :CONFMENU if %userinp%==6 (if %SkipISO% equ 0 (set SkipISO=1) else (set SkipISO=0))&goto :CONFMENU if %userinp%==5 (if %wim2esd% equ 1 (set wim2esd=0) else (set wim2esd=1&if %wim2swm% equ 0 (set wim2swm=1) else (set wim2swm=0)))&goto :CONFMENU if %userinp%==4 (if %StartVirtual% equ 0 (set StartVirtual=1) else (set StartVirtual=0))&goto :CONFMENU if %userinp%==3 if %AddUpdates% neq 0 (if %NetFx3% equ 0 (set NetFx3=1) else (set NetFx3=0))&goto :CONFMENU if %userinp%==2 if %AddUpdates% equ 1 (if %Cleanup% equ 1 (set Cleanup=0) else (set Cleanup=1&if %ResetBase% equ 0 (set ResetBase=1) else if %ResetBase% equ 1 (set ResetBase=2) else (set ResetBase=0)))&goto :CONFMENU if %userinp%==1 (if %AddUpdates% equ 0 (set AddUpdates=1) else if %AddUpdates% equ 1 (set AddUpdates=2) else (set AddUpdates=0))&goto :CONFMENU goto :CONFMENU

:ISO @cls call :dk_color1 %Gray% "=== Running UUP Converter %uivr% ===" 4 5 call :checkQE set _initial= if %_updexist% equ 0 set AddUpdates= if %PREPARED% equ 0 call :PREPARE call :optDrivers if %_build% equ 25398 set SkipApps= if %_SrvESD% equ 1 set StubAppsFull= if %_IPA% equ 1 if %SkipApps% equ 0 set _runIPA= if %CustomList% neq 0 if exist "CustomAppsList.txt" set _appsCustom= if /i %arch%==arm64 if %winbuild% lss 9600 if %AddUpdates% equ 1 ( if %_build% geq 17763 (set AddUpdates=2) else (set AddUpdates=0) ) if %Cleanup% equ 0 set ResetBase= if %AIO% neq 1 if %_count% leq 1 ( if /i "%editionid%"=="PPIPro" set StartVirtual= if /i "%editionid%"=="WNC" set StartVirtual= ) if %_build% lss 17063 (set StartVirtual=0) if %_build% lss 17763 if %AddUpdates% equ 2 (set AddUpdates=1) if %_build% lss 17763 if %AddUpdates% equ 1 if %W10UI% equ 0 (set AddUpdates=0) if %_build% geq 17763 if %AddUpdates% equ 1 if %W10UI% equ 0 (set AddUpdates=2) if %_build% lss 17763 if %AddUpdates% equ 1 (set Cleanup=1) if %_build% geq 22000 ( if %LCUwinre% equ 2 (set LCUwinre=0) if %_build% geq 26052 (set LCUwinre=0) ) if %_build% lss 22621 set LCUmsuExpand= if %_build% geq 26052 ( if %LCUmsuExpand% equ 2 (set LCUmsuExpand=0) else (set LCUmsuExpand=1) if %_updexist% equ 1 if exist "!_UUP!*Windows1-KB5101682.msu" set LCUmsuExpand= if %_updexist% equ 1 if exist "!_UUP!*Windows1-KB5101683*.msu" set LCUmsuExpand= ) if %_build% geq 25380 ( if %Cleanup% equ 0 set DisableUpdatingUpgrade= ) if %_build% geq 26000 ( if %DisableUpdatingUpgrade% equ 2 (set DisableUpdatingUpgrade=0) else (set DisableUpdatingUpgrade=1) ) if %_build% geq 27965 (set NetFx3=0) if %WIMFILE%==install.wim ( if %AddUpdates% neq 1 if %wim2esd% equ 1 (set WIMFILE=install.esd) ) if %WIMFILE%==install.esd ( set wim2esd= if %AddUpdates% equ 1 (set WIMFILE=install.wim&set wim2esd=1) if %_runIPA% equ 1 (set WIMFILE=install.wim&set wim2esd=1) if defined DrvOpt (set WIMFILE=install.wim&set wim2esd=1) ) if %_Debug% neq 0 set wim2esd= for %%# in ( AutoStart AddUpdates Cleanup ResetBase NetFx StartVirtual SkipISO SkipWinRE

if %_build% geq 18890 if %_build% lss 27500 ( wimlib-imagex.exe extract "!MetadataESD!" 3 Windows\Boot\Fonts* --dest-dir=ISOFOLDER\boot\fonts --no-acls --no-attributes %_Nul3% xcopy /CRY ISOFOLDER\boot\fonts* ISOFOLDER\efi\microsoft\boot\fonts\ %_Nul3% ) if %_build% lss 17063 if exist ISOFOLDER\sources\ei.cfg ( if %AIO% equ 1 del /f /q ISOFOLDER\sources\ei.cfg %_Nul3% if %_count% gtr 1 del /f /q ISOFOLDER\sources\ei.cfg %_Nul3% ) if %_build% geq 17063 ( if exist "!_UUP!\ei.cfg" (copy /y "!_UUP!\ei.cfg" ISOFOLDER\sources\ei.cfg %_Nul3%) else if exist "ei.cfg" (copy /y "ei.cfg" ISOFOLDER\sources\ei.cfg %_Nul3%) if exist "!_UUP!\pid.txt" (copy /y "!_UUP!\pid.txt" ISOFOLDER\sources\pid.txt %_Nul3%) else if exist "pid.txt" (copy /y "pid.txt" ISOFOLDER\sources\pid.txt %_Nul3%) ) if %AIO% neq 1 if %_count% leq 1 if /i "%editionid%"=="PPIPro" ( ( echo [PID] echo Value=XKCNC-J26Q9-KFHD2-FKTHY-KD72Y )>ISOFOLDER\sources\pid.txt ) for /f "tokens=5-10 delims=: " %%G in ('wimlib-imagex.exe info "!MetadataESD!" 3 ^| find /i "Last Modification Time"') do (set mmm=%%G&set "isotime=%%H/%%L,%%I:%%J:%%K") for %%# in (Jan:01 Feb:02 Mar:03 Apr:04 May:05 Jun:06 Jul:07 Aug:08 Sep:09 Oct:10 Nov:11 Dec:12) do for /f "tokens=1, delims=:" %%A in ("%%#") do ( if /i %mmm%==%%A set "isotime=%%B/%isotime%" ) set _file=ISOFOLDER\sources%WIMFILE% set _rtrn=RetISO goto :InstallWim :RetISO if %WIMFILE%==install.esd ( set wim2swm= if %_Debug% neq 0 set SkipWinRE= ) set _rtrn=BakISO goto :WinreWim :BakISO call :dk_color1 %Blue% "=== Creating boot.wim.. ." 4 if %AddUpdates% equ 2 if %_updexist% equ 1 ( call :uups_du ) if %relite% equ 0 (set _srcwim=temp\winre.wim) else (set _srcwim=temp\boot.wim) copy /y %_srcwim% ISOFOLDER\sources\boot.wim %_Nul1% wimlib-imagex.exe info ISOFOLDER\sources\boot.wim 1 "Microsoft Windows PE (%arch%)" "Microsoft Windows PE (%arch%)" --image-property FLAGS=9 %_Nul3% wimlib-imagex.exe update ISOFOLDER\sources\boot.wim 1 --command="delete '\Windows\system32\winpeshl.ini'" %_Nul3% if %ForceDism% equ 0 ( call :BootPE ) else ( call :BootADK ) if %RefESD% neq 0 call :uups_backup if exist "!_cabdir!" ( if %AddUpdates% equ 1 if %_updexist% equ 1 call :dk_color1 %Blue% "=== Removing temporary files.. ." 4 rmdir /s /q "!cabdir!" %Nul3% ) if %extVirt% equ 1 if %DeleteSource% neq 1 ( set DVDLABEL=CCSA%archl%FRE%langid%%ddv%&set DVDISO=%label%MULTI%archl%FRE%langid% ) if %StartVirtual% neq 0 if %_SrvESD% equ 0 if %_extVirt% equ 0 ( ren ISOFOLDER %DVDISO% if %SkipISO% neq 0 (set qmsg=Finished. You chose not to create iso file.) else (set qmsg=Finished.) if %AutoStart% neq 0 (goto :V_Auto) else (goto :V_Manu) ) set wimsort= for /f "tokens=3 delims=: " %%# in ('imagex /info ISOFOLDER\sources%WimFile% ^|findstr /i /b /c:"Image Count"') do set finalimages=%%# if defined SortEditions if %finalimages% gtr 1 if %_SrvESD% equ 0 ( if %_extVirt% equ 1 (set wimsort=1) else if %StartVirtual% equ 0 (set wimsort=1) ) if %wimsort% equ 1 ( call :dk_color1 %Blue% "=== Sorting Edition{s}.. ." 4 5 call :doSort ) set isiso= set _rtrn=finISO goto :esdSWM :finISO if %SkipISO% neq 0 ( ren ISOFOLDER %DVDISO%

set qmsg=Finished. You chose not to create iso file. goto :QUIT ) call :dk_color1 %Blue% "=== Creating ISO.. ." 4 if /i not %arch%==arm64 ( cdimage.exe -bootdata:2#p0,e,b"ISOFOLDER\boot\etfsboot.com"#pEF,e,b"ISOFOLDER\efi\Microsoft\boot\efisys.bin" -o -m -u -udfver102 -t%isotime% -l%DVDLABEL% ISOFOLDER %DVDISO%.ISO %_Supp% ) else ( cdimage.exe -bootdata:1#pEF,e,b"ISOFOLDER\efi\Microsoft\boot\efisys.bin" -o -m -u2 -udfver102 -t%isotime% -l%DVDLABEL% ISOFOLDER %DVDISO%.ISO %_Supp% ) set ERRTEMP=%ERRORLEVEL% if %ERRTEMP% neq 0 goto :E_ISO set qmsg=Finished. goto :QUIT

:Single @cls call :dk_color1 %Gray% "=== Running UUP Converter %uivr% ===" 4 5 call :checkQE set _initial= if %_updexist% equ 0 set AddUpdates= if %PREPARED% equ 0 call :PREPARE call :optDrivers if %_build% equ 25398 set SkipApps= if %_SrvESD% equ 1 set StubAppsFull= if %_IPA% equ 1 if %SkipApps% equ 0 set _runIPA= if %CustomList% neq 0 if exist "CustomAppsList.txt" set _appsCustom= if %W10UI% equ 0 (set AddUpdates=0) if /i %arch%==arm64 if %winbuild% lss 9600 if %AddUpdates% equ 1 (set AddUpdates=0) if %Cleanup% equ 0 set ResetBase= if %_build% lss 17763 if %AddUpdates% equ 1 (set Cleanup=1) if %_build% geq 22000 ( if %LCUwinre% equ 2 (set LCUwinre=0) if %_build% geq 26052 (set LCUwinre=0) ) if %_build% lss 22621 set LCUmsuExpand= if %_build% geq 26052 ( if %LCUmsuExpand% equ 2 (set LCUmsuExpand=0) else (set LCUmsuExpand=1) if %_updexist% equ 1 if exist "!_UUP!*Windows1-KB5101682.msu" set LCUmsuExpand= if %_updexist% equ 1 if exist "!_UUP!*Windows1-KB5101683*.msu" set LCUmsuExpand= ) if %_build% geq 25380 ( if %Cleanup% equ 0 set DisableUpdatingUpgrade= ) if %_build% geq 26000 ( if %DisableUpdatingUpgrade% equ 2 (set DisableUpdatingUpgrade=0) else (set DisableUpdatingUpgrade=1) ) if %_build% geq 27965 (set NetFx3=0) if %WIMFILE%==install.wim ( if %AddUpdates% neq 1 if %wim2esd% equ 1 (set WIMFILE=install.esd) ) if %WIMFILE%==install.esd ( set wim2esd= if %AddUpdates% equ 1 (set WIMFILE=install.wim&set wim2esd=1) if %_runIPA% equ 1 (set WIMFILE=install.wim&set wim2esd=1) if defined DrvOpt (set WIMFILE=install.wim&set wim2esd=1) ) if %_Debug% neq 0 set wim2esd= if exist "!_work!%WIMFILE%" ( call :dk_color1 %Red% "An %WIMFILE% file is already present in the current folder" 4 5 (echo.&echo An %WIMFILE% file is already present in the current folder)>>"!logerr!" goto :QUIT ) for %%# in ( AutoStart AddUpdates Cleanup ResetBase SkipWinRE LCUwinre LCUmsuExpand DisableUpdatingUpgrade wim2esd wim2swm RefESD SkipLCUmsu SkipEdge AutoExit AddDrivers SkipApps

(echo.&echo Errors were reported during export. Discarding install.esd)>>"!logerr!" del /f /q %cnvrt%.esd %_Nul3% ) if exist %cnvrt%.esd del /f /q %cnvrt%.wim goto :%_rtrn% :swmESD call :dk_color1 %Blue% "=== Splitting install.wim into install.swm.. ." 4 5 wimlib-imagex.exe split %cnvrt%.wim %cnvrt%.swm 3500 %_Supp% set ERRTEMP=%ERRORLEVEL% if %ERRTEMP% neq 0 ( call :dk_color1 %Red% "Errors were reported during split. Discarding install.swm" 4 (echo.&echo Errors were reported during split. Discarding install.swm)>>"!logerr!" del /f /q %cnvrt%.swm %_Nul3% ) if exist %cnvrt%*.swm del /f /q %cnvrt%.wim goto :%_rtrn%

:InstallWim call :DismHostON call :dk_color1 %Blue% "=== Creating %WIMFILE%.. ." 4 5 if exist "temp*.ESD" (set _rrr=--ref="temp*.esd") else (set "_rrr=") if %WIMFILE%==install.wim set _rrr=%_rrr% --compress=LZX wimlib-imagex.exe export "!MetadataESD!" 3 %_file% --ref="!_UUP!*.esd" %_rrr% %_Supp% set ERRTEMP=%ERRORLEVEL% if %ERRTEMP% neq 0 goto :E_Export if !_Srvr! equ 1 ( wimlib-imagex.exe info %_file% 1 "%_wsr% %_flg%" "%_wsr% %_flg%" --image-property DISPLAYNAME="!_dName!" --image-property DISPLAYDESCRIPTION="!_dDesc!" --image-property FLAGS=%_flg% %_Nul3% ) else if !FixDisplay! equ 1 ( wimlib-imagex.exe info %_file% 1 "!_os!" "!_os!" --image-property DISPLAYNAME="!_dName!" --image-property DISPLAYDESCRIPTION="!_dDesc!" --image-property FLAGS=%_flg% %_Nul3% ) else ( wimlib-imagex.exe info %_file% 1 --image-property DISPLAYNAME="!_dName!" --image-property DISPLAYDESCRIPTION="!_dDesc!" --image-property FLAGS=%_flg% %_Nul3% ) set _img= if %_count% gtr 1 for /L %%i in (2,1,%_count%) do ( for /L %%# in (1,1,%uups_esd_num%) do if !_index%%i! equ %%# ( wimlib-imagex.exe export "!_UUP!!uups_esd%%#!" 3 %_file% --ref="!_UUP!*.esd" %_rrr% %_Supp% call set ERRTEMP=!ERRORLEVEL! if !ERRTEMP! neq 0 goto :E_Export set /a _img+= if !_ESDSrv%%#! equ 1 ( wimlib-imagex.exe info %_file% !_img! "%_wsr% !edition%%#!" "%_wsr% !edition%%#!" --image-property DISPLAYNAME="!_dName%%#!" --image-property DISPLAYDESCRIPTION="!_dDesc%%#!" --image-property FLAGS=!edition%%#! %_Nul3% ) else if !FixDisplay! equ 1 ( wimlib-imagex.exe info %_file% !_img! "!_os%%#!" "!_os%%#!" --image-property DISPLAYNAME="!_dName%%#!" --image-property DISPLAYDESCRIPTION="!_dDesc%%#!" --image-property FLAGS=!edition%%#! %_Nul3% ) else ( wimlib-imagex.exe info %_file% !_img! --image-property DISPLAYNAME="!_dName%%#!" --image-property DISPLAYDESCRIPTION="!_dDesc%%#!" --image-property FLAGS=!edition%%#! %_Nul3% ) ) ) if %AIO% equ 1 for /L %%# in (2,1,%uups_esd_num%) do ( wimlib-imagex.exe export "!_UUP!!uups_esd%%#!" 3 %_file% --ref="!_UUP!*.esd" %_rrr% %_Supp% call set ERRTEMP=!ERRORLEVEL! if !ERRTEMP! neq 0 goto :E_Export if !_ESDSrv%%#! equ 1 ( wimlib-imagex.exe info %_file% %%# "%_wsr% !edition%%#!" "%_wsr% !edition%%#!" --image-property DISPLAYNAME="!_dName%%#!" --image-property DISPLAYDESCRIPTION="!_dDesc%%#!" --image-property FLAGS=!edition%%#! %_Nul3% ) else if !FixDisplay! equ 1 ( wimlib-imagex.exe info %_file% %%# "!_os%%#!" "!_os%%#!" --image-property DISPLAYNAME="!_dName%%#!" --image-property DISPLAYDESCRIPTION="!_dDesc%%#!" --image-property FLAGS=!edition%%#! %_Nul3% ) else ( wimlib-imagex.exe info %_file% %%# --image-property DISPLAYNAME="!_dName%%#!" --image-property DISPLAYDESCRIPTION="!_dDesc%%#!" --image-property FLAGS=!edition%%#! %_Nul3% ) ) if %_updexist% equ 1 if %_build% geq 22000 if exist "%SysPath%\ucrtbase.dll" if not exist "bin\dpx.dll" if not exist "temp\dpx.dll" call :uups_dll dpx if %_reMSU% equ 1 if %_build% geq 25336 call :uups_msu if %_reMSU% equ 1 if %_build% lss 25336 ( if exist "!_UUP!*Windows1-KB.wim" (call :uups_msu) else (if %SkipLCUmsu% equ 0 call :uups_msu) ) if exist "!_cabdir!" rmdir /s /q "!_cabdir!" del /f /q %_dLog%* %_Nul3% if not exist "%_dLog%" mkdir "%_dLog%" %_Nul3% if not exist "%SystemRoot%\temp" mkdir "%SystemRoot%\temp" %_Nul3% del /f /q %SystemRoot%\temp*.mum %_Nul3% set mounted=

set _runDRV= if %AddUpdates% neq 1 if %W10UI% neq 0 if %_runIPA% equ 1 ( set mounted= if %_file%==%WIMFILE% (call :uups_update %WIMFILE% appx) else (call :uups_update install.iso appx) ) if %AddUpdates% equ 1 if %_updexist% equ 1 ( set mounted= if %_file%==%WIMFILE% (call :uups_update %WIMFILE%) else (call :uups_update install.iso) ) set _runDRV= if defined DrvOpt if %mounted% equ 0 ( if %_file%==%WIMFILE% (call :uups_update %WIMFILE%) else (call :uups_update install.iso) ) if %_file%==%WIMFILE% goto :%_rtrn% if %AddUpdates% equ 2 if %_updexist% equ 1 ( call :uups_external ) goto :%_rtrn%

:WinreWim call :dk_color1 %Blue% "=== Creating winre.wim.. ." 4 5 wimlib-imagex.exe export "!MetadataESD!" 2 temp\winre.wim --compress=LZX --boot %_Supp% set ERRTEMP=%ERRORLEVEL% if %ERRTEMP% neq 0 goto :E_Export set mounted= set _runDRV= if %uwinpe% equ 1 if %AddUpdates% equ 1 if %_updexist% equ 1 ( set mounted= call :uups_update temp\winre.wim ) set _runDRV= if defined DrvOpt if %mounted% equ 0 ( call :uups_update temp\winre.wim ) if %relite% neq 0 ( echo. ren temp\winre.wim boot.wim wimlib-imagex.exe export temp\boot.wim 2 temp\winre.wim --compress=LZX --boot %_Supp% wimlib-imagex.exe delete temp\boot.wim 2 --soft %_Nul3% ) if %SkipWinRE% neq 0 goto :%_rtrn% call :dk_color1 %Blue% "=== Adding winre.wim to %WIMFILE%.. ." 4 for /f "tokens=3 delims=: " %%# in ('wimlib-imagex.exe info %_file% ^| findstr /c:"Image Count"') do set imgcount=%%# for /L %%# in (1,1,%imgcount%) do ( wimlib-imagex.exe update %_file% %%# --command="add 'temp\winre.wim' '\windows\system32\recovery\winre.wim'" %_Null% ) goto :%_rtrn%

:BootADK if %W10UI% equ 0 goto :BootPE if exist "%_mount%" rmdir /s /q "%_mount%" if not exist "%_mount%" mkdir "%_mount%" %_dism1% /Mount-Wim /Wimfile:ISOFOLDER\sources\boot.wim /Index:1 /MountDir:"%_mount%" %_Supp% set ERRTEMP=%ERRORLEVEL% if %ERRTEMP% neq 0 ( call :dismount rmdir /s /q "%_mount%" (echo.&echo Failed mounting boot.wim)>>"!logerr!" goto :BootPE ) call :wds_add if %_build% geq 26052 if exist "%_mount%\Windows\Servicing\Packages\WinPE-Rejuv-Package~.mum" ( for /f "delims=" %%# in ('dir /b /a:-d "%_mount%\Windows\Servicing\Packages\WinPE-Rejuv-Package~.mum"') do ( %_dism1% /Image:"%_mount%" /LogPath:"%_dLog%\DismNUL.log" /Remove-Package /PackageName:%%~n# %_Nul3% ) call :wds_rem %_dism1% /Commit-Image /MountDir:"%_mount%" /Append %_Supp% call :wds_add set relite= set ready2= ) %_dism1% /Image:"%_mount%" /LogPath:"%_dLog%\DismNUL.log" /Set-TargetPath:X:$windows.~bt if !errorlevel! neq 0 ( (echo.&echo Dism.exe Set-TargetPath for boot.wim failed)>>"!logerr!" ) call :wds_rem if %_build% geq 22000 ( reg.exe load "HKLM\WinPEwim" "%_mount%\Windows\System32\Config\SOFTWARE" %_Nul3% reg.exe add "HKLM\WinPEwim%_wper%" /f /v CustomBackground /t REG_EXPAND_SZ /d "%_root%\System32\winre.jpg" %_Nul3% reg.exe delete "HKLM\WinPEwim%_wper%" /f /v CustomShell %_Nul3% reg.exe unload "HKLM\WinPEwim" %_Nul3%

del /f /q ISOFOLDER\sources\xmllite.dll %_Nul3% del /f /q ISOFOLDER\sources\winpe.jpg %_Nul3% del /f /q ISOFOLDER\sources\winre.jpg %_Nul3% rmdir /s /q bin\temp exit /b

:set_bkimg if exist "ISOFOLDER\sources\winpe.jpg" del /f /q ISOFOLDER\sources\winpe.jpg %_Nul3% if exist "ISOFOLDER\sources\winre.jpg" del /f /q ISOFOLDER\sources\winre.jpg %_Nul3% wimlib-imagex.exe extract ISOFOLDER\sources\boot.wim 1 Windows\System32\winpe.jpg --dest-dir=ISOFOLDER\sources --no-acls --no-attributes --nullglob %_Null% wimlib-imagex.exe extract ISOFOLDER\sources\boot.wim 1 Windows\System32\winre.jpg --dest-dir=ISOFOLDER\sources --no-acls --no-attributes --nullglob %_Null% for %%# in (background_cli.bmp, background_svr.bmp, background_cli.png, background_svr.png, winpe.jpg) do (if exist "ISOFOLDER\sources%%#" if not defined _bkimg set "_bkimg=%%#") exit /b

:INFO if %PREPARED% equ 0 call :PREPARE @cls call :dk_color2 %_White% " " %Blue% "=== UUP Contents Info ===" 0 8 echo Arch: %arch% echo Language: %langid% echo Version: %ver1%.%ver2%.%_build%.%svcbuild% echo Branch: %branch% echo OS: %_os% echo. %_Contn%&%_Pause% goto :MAINMENU

:INFOAIO if %PREPARED% equ 0 call :PREPARE @cls call :dk_color2 %_White% " " %Blue% "=== UUP Contents Info ===" 0 8 echo Arch: %arch% echo Version: %ver1%.%ver2%.%_build%.%svcbuild% echo Branch: %branch% echo Editions: for /L %%# in (1,1,%uups_esd_num%) do ( echo %%#. !_name%%#! ) echo. %_Contn%&%_Pause% goto :MAINMENU

:PREPARE if %_initial% equ 0 @cls call :dk_color1 %Blue% "=== Checking UUP Info.. ." set PREPARED= if %AIO% equ 1 set "MetadataESD=!_UUP!%uups_esd1%"&set "_flg=%edition1%"&set "arch=%arch1%"&set "langid=%langid1%"&set "_oName=%_oname1%"&set "_Srvr=%_ESDSrv1%" if %_count% gtr 1 set "MetadataESD=!_UUP!!uups_esd%_index1%!"&set "_flg=!edition%_index1%!"&set "arch=!arch%_index1%!"&set "langid=!langid%_index1%!"&set "_oName=!_oname%_index1%!"&set "_Srvr=!_ESDSrv%_index1%!" imagex /info "!MetadataESD!" 3 >bin\info.txt 2>& for /f "tokens=3 delims=<>" %%# in ('find /i "" bin\info.txt') do set ver1=%%# for /f "tokens=3 delims=<>" %%# in ('find /i "" bin\info.txt') do set ver2=%%# for /f "tokens=3 delims=<>" %%# in ('find /i "" bin\info.txt') do set _build=%%# for /f "tokens=3 delims=<>" %%# in ('find /i "" bin\info.txt') do set svcbuild=%%# for /f "tokens=3 delims=<>" %%# in ('imagex /info "!MetadataESD!" 3 ^| find /i "" %_Nul6%') do if /i "%%#"=="/DISPLAYNAME" (set FixDisplay=1) set /a _fixSV=%_build%+ if %uups_esd_num% gtr 1 for /L %%A in (2,1,%uups_esd_num%) do ( imagex /info "!_UUP!!uups_esd%%A!" 3 >bin\info%%A.txt 2>& ) for /f "tokens=" %%A in ('chcp') do for %%B in (%%A) do set "oemcp=%%~nB" >nul chcp 65001 cmd.exe /u /c type bin\info.txt>bin\infou.txt if %uups_esd_num% gtr 1 for /L %%A in (2,1,%uups_esd_num%) do ( cmd.exe /u /c type bin\info%%A.txt>bin\info%%Au.txt ) for /f "tokens=3 delims=<>" %%# in ('find /i "" bin\infou.txt') do (set "_dName=%%#"&set "_os=%%#") for /f "tokens=3 delims=<>" %%# in ('find /i "" bin\infou.txt') do set "_dDesc=%%#" for %%# in (ru-ru,zh-cn,zh-tw,zh-hk) do if /i %langid%==%%# set "_os=!_oName!" if %uups_esd_num% gtr 1 for /L %%A in (2,1,%uups_esd_num%) do ( for /f "tokens=3 delims=<>" %%# in ('find /i "" bin\info%%Au.txt') do (set "_dName%%A=%%#"&set "_os%%A=%%#") for /f "tokens=3 delims=<>" %%# in ('find /i "" bin\info%%Au.txt') do set "_dDesc%%A=%%#" for %%# in (ru-ru,zh-cn,zh-tw,zh-hk) do if /i !langid%%A!==%%# set "_os%%A=!_oName%%A!" ) >nul chcp %oemcp% del /f /q bin\info.txt if %_build% geq 21382 if exist "!_UUP!*.AggregatedMetadata.cab" if exist "!_UUP!*Windows1-KB*.cab" if exist

"!_UUP!*Windows1-KB.psf" set _reMSU= if %_build% geq 22621 if exist "!_UUP!*.AggregatedMetadata.cab" if exist "!_UUP!*Windows1-KB.wim" if exist "!_UUP!*Windows1-KB.psf" set _reMSU= if %_build% geq 22563 ( if exist "!_UUP!*.appx" set _OPA= if exist "!_UUP!*.msix" set _OPA= ) if %_build% geq 22563 if exist "!_UUP!*.AggregatedMetadata.cab" ( if %_OPA% equ 1 set _IPA= if exist "!_UUP!\Apps*_8wekyb3d8bbwe" set _IPA= ) if %_build% geq 22621 if exist "!_UUP!*Edge.wim" ( set _wimEdge= if not exist "!_UUP!\Edge.wim" for /f %%# in ('dir /b /a:-d "!_UUP!*Edge.wim"') do rename "!_UUP!%%#" Edge.wim %_Nul3% ) set _dpx= if %_updexist% equ 1 if %_build% geq 22000 if exist "%SysPath%\ucrtbase.dll" if exist "!_UUP!*DesktopDeployment.cab" ( if /i %arch%==%xOS% set _dpx= if /i %arch%==x64 if /i %xOS%==amd64 set _dpx= ) if %_dpx% equ 1 ( for /f "delims=" %%# in ('dir /b /a:-d "!_UUP!*DesktopDeployment.cab"') do expand.exe -f:dpx.dll "!_UUP!%%#" .\temp %_Null% copy /y %SysPath%\expand.exe temp\ %_Nul3% ) wimlib-imagex.exe extract "!MetadataESD!" 1 sources\ei.cfg --dest-dir=.\bin\temp --no-acls --no-attributes %_Nul3% if exist "bin\temp\ei.cfg" type .\bin\temp\ei.cfg %_Nul2% | find /i "Volume" %_Nul1% && set VOL= wimlib-imagex.exe extract "!MetadataESD!" 1 sources\setuphost.exe --dest-dir=.\bin\temp --no-acls --no-attributes %_Nul3% 7z.exe l .\bin\temp\setuphost.exe >.\bin\temp\version.txt 2>& if %_build% geq 22478 ( wimlib-imagex.exe extract "!MetadataESD!" 3 Windows\System32\UpdateAgent.dll --dest-dir=.\bin\temp --no-acls --no-attributes --ref="!_UUP!*.esd" %_Nul3% if exist "bin\temp\UpdateAgent.dll" 7z.exe l .\bin\temp\UpdateAgent.dll >.\bin\temp\version.txt 2>& ) for /f "tokens=4-7 delims=.() " %%i in ('"findstr /i /b "FileVersion" .\bin\temp\version.txt" %_Nul6%') do (set uupver=%%i.%%j&set uupmaj=%%i&set uupmin=%%j&set branch=%%k&set uupdate=%%l&set bkpdate=%%l) set revver=%uupver%&set revmaj=%uupmaj%&set revmin=%uupmin% set "tok=6,7"&set "toe=5,6,7" if /i %arch%==x86 (set _ss=x86) else if /i %arch%==x64 (set _ss=amd64) else (set _ss=arm64) wimlib-imagex.exe extract "!MetadataESD!" 3 Windows\WinSxS\Manifests%_ss%_microsoft-windows-coreos-revision.manifest --dest-dir=.\bin\temp --no-acls --no-attributes --ref="!_UUP!*.esd" %_Nul3% if exist "bin\temp*_microsoft-windows-coreos-revision.manifest" for /f "tokens=%tok% delims=_." %%i in ('dir /b /a:-d /od .\bin\temp*_microsoft-windows-coreos-revision*.manifest') do (set revver=%%i.%%j&set revmaj=%%i&set revmin=%%j) if %_build% geq 15063 ( wimlib-imagex.exe extract "!MetadataESD!" 3 Windows\System32\config\SOFTWARE --dest-dir=.\bin\temp --no-acls --no-attributes %_Null% set "isokey=Microsoft\Windows NT\CurrentVersion\Update\TargetingInfo\Installed" for /f %%i in ('"offlinereg.exe .\bin\temp\SOFTWARE "!isokey!" enumkeys %_Nul6% ^| findstr /i /r "Client.OS Server.OS WNC.OS WCOSDevice""') do if not errorlevel 1 ( for /f "tokens=3 delims==:" %%A in ('"offlinereg.exe .\bin\temp\SOFTWARE "!isokey!%%i" getvalue Branch %_Nul6%"') do set "revbranch=%%~A" for /f "tokens=5,6 delims==:." %%A in ('"offlinereg.exe .\bin\temp\SOFTWARE "!isokey!%%i" getvalue Version %_Nul6%"') do if %%A gtr !revmaj! ( set "revver=%%~A.%%B set revmaj=%%~A set "revmin=%%B ) ) ) if defined revbranch set branch=%revbranch% call :fixBranch %revmaj% if %uupmin% lss %revmin% ( set uupver=%revver% set uupmin=%revmin% call :get_lcu_pkg ) set _legacy= set _useold= if /i "%branch%"=="WinBuild" set _useold= if /i "%branch%"=="GitEnlistment" set _useold= if /i "%uupdate%"=="winpbld" set _useold= if /i "%uupdate%"=="160101" set _useold= if %_useold% equ 1 ( wimlib-imagex.exe extract "!MetadataESD!" 3 Windows\System32\config\SOFTWARE --dest-dir=.\bin\temp --no-acls --no-attributes %_Null% for /f "tokens=3 delims==:" %%# in ('"offlinereg.exe .\bin\temp\SOFTWARE "Microsoft\Windows NT\CurrentVersion" getvalue BuildLabEx" %_Nul6%') do if not errorlevel 1 (for /f "tokens=1-5 delims=." %%i in ('echo %%~#') do set _legacy=%%i.%%j.%%m.%%l&set branch=%%l) )

DVDISO=%label%ENTERPRISEGN_VOL%archl%FRE_%langid%&exit /b if /i %editionid%==EnterpriseS set DVDLABEL=CES_%archl%FREV_%langid%%ddv%&set DVDISO=%label%ENTERPRISES_VOL%archl%FRE%langid%&exit /b if /i %editionid%==EnterpriseSN set DVDLABEL=CESNN%archl%FREV_%langid%%ddv%&set DVDISO=%label%ENTERPRISESN_VOL%archl%FRE%langid%&exit /b if /i %editionid%==ProfessionalEducation (if %VOL% equ 1 (set DVDLABEL=CPREA%archl%FREV_%langid%%ddv%&set DVDISO=%label%PROEDUCATION_VOL%archl%FRE%langid%) else (set DVDLABEL=CPREA%archl%FRE_%langid%%ddv%&set DVDISO=%label%PROEDUCATION_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ProfessionalEducationN (if %VOL% equ 1 (set DVDLABEL=CPRENA%archl%FREV_%langid%%ddv%&set DVDISO=%label%PROEDUCATIONN_VOL%archl%FRE%langid%) else (set DVDLABEL=CPRENA%archl%FRE_%langid%%ddv%&set DVDISO=%label%PROEDUCATIONN_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ProfessionalWorkstation (if %VOL% equ 1 (set DVDLABEL=CPRWA%archl%FREV_%langid%%ddv%&set DVDISO=%label%PROWORKSTATION_VOL%archl%FRE%langid%) else (set DVDLABEL=CPRWA%archl%FRE_%langid%%ddv%&set DVDISO=%label%PROWORKSTATION_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ProfessionalWorkstationN (if %VOL% equ 1 (set DVDLABEL=CPRWNA%archl%FREV_%langid%%ddv%&set DVDISO=%label%PROWORKSTATIONN_VOL%archl%FRE%langid%) else (set DVDLABEL=CPRWNA%archl%FRE_%langid%%ddv%&set DVDISO=%label%PROWORKSTATIONN_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ProfessionalSingleLanguage set DVDLABEL=CPRSLA%archl%FREO_%langid%%ddv%&set DVDISO=%label%PROSINGLELANGUAGE_OEM%archl%FRE%langid%&exit /b if /i %editionid%==ProfessionalCountrySpecific set DVDLABEL=CPRCHA%archl%FREO_%langid%%ddv%&set DVDISO=%label%PROCHINA_OEM%archl%FRE%langid%&exit /b if /i %editionid%==CloudEdition (if %VOL% equ 1 (set DVDLABEL=CWCA%archl%FREV_%langid%%ddv%&set DVDISO=%label%CLOUD_VOL%archl%FRE%langid%) else (set DVDLABEL=CWCA%archl%FRE_%langid%%ddv%&set DVDISO=%label%CLOUD_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==CloudEditionN (if %VOL% equ 1 (set DVDLABEL=CWCNNA%archl%FREV_%langid%%ddv%&set DVDISO=%label%CLOUDN_VOL%archl%FRE%langid%) else (set DVDLABEL=CWCNNA%archl%FRE_%langid%%ddv%&set DVDISO=%label%CLOUDN_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ServerStandard (if %VOL% equ 1 (set DVDLABEL=SSS%archl%FREV_%langid%%ddv%&set DVDISO=%label%STANDARD_VOL%archl%FRE%langid%) else (set DVDLABEL=SSS%archl%FRE_%langid%%ddv%&set DVDISO=%label%STANDARD_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ServerStandardCore (if %VOL% equ 1 (set DVDLABEL=SSS%archl%FREV_%langid%%ddv%&set DVDISO=%label%STANDARDCORE_VOL%archl%FRE%langid%) else (set DVDLABEL=SSS%archl%FRE_%langid%%ddv%&set DVDISO=%label%STANDARDCORE_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ServerDatacenter (if %VOL% equ 1 (set DVDLABEL=SSS%archl%FREV_%langid%%ddv%&set DVDISO=%label%DATACENTER_VOL%archl%FRE%langid%) else (set DVDLABEL=SSS%archl%FRE_%langid%%ddv%&set DVDISO=%label%DATACENTER_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ServerDatacenterCore (if %VOL% equ 1 (set DVDLABEL=SSS%archl%FREV_%langid%%ddv%&set DVDISO=%label%DATACENTERCORE_VOL%archl%FRE%langid%) else (set DVDLABEL=SSS%archl%FRE_%langid%%ddv%&set DVDISO=%label%DATACENTERCORE_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ServerTurbine (if %VOL% equ 1 (set DVDLABEL=SADC%archl%FREV_%langid%%ddv%&set DVDISO=%label%TURBINE_VOL%archl%FRE%langid%) else (set DVDLABEL=SADC%archl%FRE_%langid%%ddv%&set DVDISO=%label%TURBINE_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ServerTurbineCore (if %VOL% equ 1 (set DVDLABEL=SADC%archl%FREV_%langid%%ddv%&set DVDISO=%label%TURBINECOR_VOL%archl%FRE%langid%) else (set DVDLABEL=SADC%archl%FRE_%langid%%ddv%&set DVDISO=%label%TURBINECOR_OEMRET%archl%FRE%langid%))&exit /b if /i %editionid%==ServerAzureStackHCICor set DVDLABEL=SASH%archl%FRE_%langid%_%ddv%&set DVDISO=%label%AZURESTACKHCI_RET%archl%FRE%langid%&exit /b exit /b

:fixBranch if %1==18363 if /i "%branch:~0,4%"=="19h1" set branch=19h2%branch:~4% if %1==19042 if /i "%branch:~0,2%"=="vb" set branch=20h2%branch:~2% if %1==19043 if /i "%branch:~0,2%"=="vb" set branch=21h1%branch:~2% if %1==19044 if /i "%branch:~0,2%"=="vb" set branch=21h2%branch:~2% if %1==19045 if /i "%branch:~0,2%"=="vb" set branch=22h2%branch:~2% if %1==20349 if /i "%branch:~0,2%"=="fe" set branch=22h2%branch:~2% if %1==22631 if /i "%branch:~0,2%"=="ni" (echo %branch% | find /i "beta" %_Nul1% || set branch=23h2_ni%branch:~2%) if %1==26200 if /i "%branch:~0,2%"=="ge" (echo %branch% | findstr /i /r "beta prerelease" %_Nul1% || set branch=25h2_ge%branch:~2%) if %1==26300 if /i "%branch:~0,2%"=="ge" (echo %branch% | findstr /i /r "beta prerelease" %_Nul1% || set branch=26h2_ge%branch:~2%) exit /b

:fixVerBrn set "_ti=!%2!" set "_tv=!%3!" set "_tb=!%4!" if %1==18363 ( if /i "%_ti:~0,4%"=="19h1" set _ti=19h2%_ti:~4% if %_tv:~0,5%==18362 set _tv=18363%_tv:~5% if /i "%_tb:~0,4%"=="19h1" set _tb=19h2%_tb:~4% ) if %1==19042 ( if /i "%_ti:~0,2%"=="vb" set _ti=20h2%_ti:~2% if %_tv:~0,5%==19041 set _tv=19042%_tv:~5% if /i "%_tb:~0,2%"=="vb" set _tb=20h2%_tb:~2% ) if %1==19043 ( if /i "%_ti:~0,2%"=="vb" set _ti=21h1%_ti:~2% if %_tv:~0,5%==19041 set _tv=19043%_tv:~5% if /i "%_tb:~0,2%"=="vb" set _tb=21h1%_tb:~2%

if %1==19044 ( if /i "%_ti:~0,2%"=="vb" set _ti=21h2%_ti:~2% if %_tv:~0,5%==19041 set _tv=19044%_tv:~5% if /i "%_tb:~0,2%"=="vb" set _tb=21h2%_tb:~2% ) if %1==19045 ( if /i "%_ti:~0,2%"=="vb" set _ti=22h2%_ti:~2% if %_tv:~0,5%==19041 set _tv=19045%_tv:~5% if /i "%_tb:~0,2%"=="vb" set _tb=22h2%_tb:~2% ) if %1==20349 ( if /i "%_ti:~0,2%"=="fe" set _ti=22h2%_ti:~2% if %_tv:~0,5%==20348 set _tv=20349%_tv:~5% if /i "%_tb:~0,2%"=="fe" set _tb=22h2%_tb:~2% ) if %1==%_fixSV% if %_build% geq 21382 ( if %_tv:~0,5%==%_build% set _tv=%_fixSV%%_tv:~5% ) if %1==22631 ( if /i "%_ti:~0,2%"=="ni" (echo %_ti% | find /i "beta" %_Nul1% || set _ti=23h2_ni%_ti:~2%) if %_tv:~0,5%==22621 set _tv=22631%_tv:~5% if /i "%_tb:~0,2%"=="ni" (echo %_tb% | find /i "beta" %_Nul1% || set _tb=23h2_ni%_tb:~2%) ) if %1==26200 ( if /i "%_ti:~0,2%"=="ge" (echo %_ti% | findstr /i /r "beta prerelease" %_Nul1% || set _ti=25h2_ge%_ti:~2%) if %_tv:~0,5%==26100 set _tv=26200%_tv:~5% if /i "%_tb:~0,2%"=="ge" (echo %_tb% | findstr /i /r "beta prerelease" %_Nul1% || set _tb=25h2_ge%_tb:~2%) ) if %1==26300 ( if /i "%_ti:~0,2%"=="ge" (echo %_ti% | findstr /i /r "beta prerelease" %_Nul1% || set _ti=26h2_ge%_ti:~2%) if %_tv:~0,5%==26100 set _tv=26300%_tv:~5% if /i "%_tb:~0,2%"=="ge" (echo %_tb% | findstr /i /r "beta prerelease" %_Nul1% || set _tb=26h2_ge%_tb:~2%) ) set "%2=%_ti%" set "%3=%_tv%" set "%4=%_tb%" exit /b

:get_lcu_pkg if not exist "%SystemRoot%\temp" mkdir "%SystemRoot%\temp" %_Nul3% wimlib-imagex.exe extract "!MetadataESD!" 3 Windows\Servicing\Packages\Package_for_RollupFix.mum --dest-dir=.\bin\temp --no-acls --no-attributes %_Nul3% if not exist "bin\temp\Package_for_RollupFix.mum" ( call set uupdate=%bkpdate% exit /b ) for /f %%# in ('dir /b /a:-d /od bin\temp\Package_for_RollupFix*.mum') do copy /y "bin\temp%%#" %SystemRoot%\temp\update.mum %_Nul1% call :datemum uupdate placebo exit /b

:datemum set "mumfile=%SystemRoot%\temp\update.mum" set "chkfile=!mumfile:=\!" if %_cwmi% equ 1 for /f "tokens=2 delims==" %%# in ('wmic datafile where "name='!chkfile!'" get LastModified /value') do set "mumdate=%%#" if %_cwmi% equ 0 for /f %%# in ('%_psc% "([WMI]'CIM_DataFile.Name=''!chkfile!''').LastModified"') do set "mumdate=%%#" set "%1=!mumdate:~2,2!!mumdate:~4,2!!mumdate:~6,2!-!mumdate:~8,4!" set "%2=!mumdate:~4,2!/!mumdate:~6,2!/!mumdate:~0,4!,!mumdate:~8,2!:!mumdate:~10,2!:!mumdate:~12,2!" exit /b

:uups_ref call :dk_color1 %Blue% "=== Preparing Reference ESDs.. ." 4 if %RefESD% neq 0 (set _level=LZX) else (set _level=XPRESS) if exist "!_UUP!*.xml.cab" if exist "!_UUP!\Metadata*" move /y "!_UUP!*.xml.cab" "!_UUP!\Metadata" %_Nul3% set _doEcho= if exist "!_UUP!*.cab" ( for /f "tokens=* delims=" %%# in ('dir /b /a:-d "!_UUP!*.cab"') do ( del /f /q temp\update.mum %_Null% expand.exe -f:update.mum "!_UUP!%%#" .\temp %_Null% if exist "temp\update.mum" call :uups_cab "%%#" ) ) if %EXPRESS% equ 1 ( for /f "tokens=* delims=" %%# in ('dir /b /a:d /o:-n "!_UUP!"') do call :uups_dir "%%#" ) if exist "!_UUP!\Metadata*.xml.cab" copy /y "!_UUP!\Metadata*.xml.cab" "!_UUP!" %_Nul3% exit /b

:uups_dir