Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >title Installer for Windows NT 10.0 Updates
- >set "_dLog=C:\Windows\Logs\DISM"
- >cd /d "!_work!"
- >if not exist "W10UI.ini" goto :proceed
- >find /i "[W10UI-Configuration]" W10UI.ini || goto :proceed
- ---------- W10UI.INI
- [W10UI-Configuration]
- >setlocal DisableDelayedExpansion
- >for %# in (target repo dismroot net35 net35source cleanup resetbase winre lcuwinre skipbootfiles skipedge _cabdir mountdir winremount wim2esd wim2swm iso isodir delete_source autostart) do (call :ReadINI %# )
- >(call :ReadINI target )
- >find /i "target " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "target " W10UI.ini') do call set "target=%~B"
- >call set "target="
- >goto :eof
- >(call :ReadINI repo )
- >find /i "repo " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "repo " W10UI.ini') do call set "repo=%~B"
- >call set "repo="
- >goto :eof
- >(call :ReadINI dismroot )
- >find /i "dismroot " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "dismroot " W10UI.ini') do call set "dismroot=%~B"
- >call set "dismroot=dism.exe"
- >goto :eof
- >(call :ReadINI net35 )
- >find /i "net35 " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "net35 " W10UI.ini') do call set "net35=%~B"
- >call set "net35=0"
- >goto :eof
- >(call :ReadINI net35source )
- >find /i "net35source " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "net35source " W10UI.ini') do call set "net35source=%~B"
- >call set "net35source="
- >goto :eof
- >(call :ReadINI cleanup )
- >find /i "cleanup " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "cleanup " W10UI.ini') do call set "cleanup=%~B"
- >call set "cleanup=1"
- >goto :eof
- >(call :ReadINI resetbase )
- >find /i "resetbase " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "resetbase " W10UI.ini') do call set "resetbase=%~B"
- >call set "resetbase=1"
- >goto :eof
- >(call :ReadINI winre )
- >find /i "winre " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "winre " W10UI.ini') do call set "winre=%~B"
- >call set "winre=0"
- >call set "winre=0"
- >goto :eof
- >(call :ReadINI lcuwinre )
- >find /i "lcuwinre " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "lcuwinre " W10UI.ini') do call set "lcuwinre=%~B"
- >call set "lcuwinre=0"
- >goto :eof
- >(call :ReadINI skipbootfiles )
- >find /i "skipbootfiles " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "skipbootfiles " W10UI.ini') do call set "skipbootfiles=%~B"
- >call set "skipbootfiles=1"
- >goto :eof
- >(call :ReadINI skipedge )
- >find /i "skipedge " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "skipedge " W10UI.ini') do call set "skipedge=%~B"
- >call set "skipedge=0"
- >goto :eof
- >(call :ReadINI _cabdir )
- >find /i "_cabdir " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "_cabdir " W10UI.ini') do call set "_cabdir=%~B"
- >call set "_cabdir=W10UItemp"
- >goto :eof
- >(call :ReadINI mountdir )
- >find /i "mountdir " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "mountdir " W10UI.ini') do call set "mountdir=%~B"
- >call set "mountdir=W10UImount"
- >goto :eof
- >(call :ReadINI winremount )
- >find /i "winremount " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "winremount " W10UI.ini') do call set "winremount=%~B"
- >call set "winremount=W10UImountre"
- >goto :eof
- >(call :ReadINI wim2esd )
- >find /i "wim2esd " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "wim2esd " W10UI.ini') do call set "wim2esd=%~B"
- >call set "wim2esd=0"
- >goto :eof
- >(call :ReadINI wim2swm )
- >find /i "wim2swm " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "wim2swm " W10UI.ini') do call set "wim2swm=%~B"
- >call set "wim2swm=0"
- >goto :eof
- >(call :ReadINI iso )
- >find /i "iso " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "iso " W10UI.ini') do call set "iso=%~B"
- >call set "iso=0"
- >goto :eof
- >(call :ReadINI isodir )
- >find /i "isodir " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "isodir " W10UI.ini') do call set "isodir=%~B"
- >call set "isodir="
- >goto :eof
- >(call :ReadINI delete_source )
- >find /i "delete_source " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "delete_source " W10UI.ini') do call set "delete_source=%~B"
- >call set "delete_source=0"
- >goto :eof
- >(call :ReadINI autostart )
- >find /i "autostart " W10UI.ini 1>nul || goto :eof
- >for /F "skip=2 tokens=1* delims==" %A in ('find /i "autostart " W10UI.ini') do call set "autostart=%~B"
- >call set "autostart=0"
- >goto :eof
- >setlocal EnableDelayedExpansion
- >goto :proceed
- >if 1 NEQ 0 set autostart=1
- >if "!repo!" == "" set "repo=!_work!"
- >if "!dismroot!" == "" set "DismRoot=dism.exe"
- >if "!_cabdir!" == "" set "_CabDir=W10UItemp"
- >if "!mountdir!" == "" set "MountDir=W10UImount"
- >if "!winremount!" == "" set "WinreMount=W10UImountre"
- >if "0" == "" set Net35=1
- >if "1" == "" set Cleanup=0
- >if "1" == "" set ResetBase=0
- >if "0" == "" set WinRE=1
- >if "0" == "" set LCUwinre=0
- >if "1" == "" set SkipBootFiles=0
- >if "0" == "" set SkipEdge=0
- >if "0" == "" set ISO=1
- >if "1" == "" set AutoStart=0
- >if "0" == "" set Delete_Source=0
- >if "0" == "" set wim2esd=0
- >if "0" == "" set wim2swm=0
- >set _ADK=0
- >set "showdism=Host OS"
- >set "_dism2=dism.exe /English /NoRestart /ScratchDir"
- >if /I not "!dismroot!" == "dism.exe" (
- set _ADK=1
- set "showdism=dism.exe"
- set _dism2="dism.exe" /English /NoRestart /ScratchDir
- )
- >set _drv=E:
- >if /I "W10UI" == "W10UI" set "_cabdir=E:\W10UItemp"
- >set _ntf=NTFS
- >if /I not "E:" == "C:" if 1 EQU 1 for /F "tokens=2 delims==" %# in ('"wmic volume where DriveLetter='E:' get FileSystem /value"') do set "_ntf=%#"
- >set "_ntf=NTFS
- "
- >if /I not "E:" == "C:" if 1 EQU 0 for /F %# in ('powershell -nop -c "(([WMISEARCHER]'Select * from Win32_Volume where DriveLetter=\"E:\"').Get()).FileSystem"') do set "_ntf=%#"
- >if /I not "NTFS" == "NTFS" set _drv=C:
- >if /I "W10UI" == "W10UI" set "mountdir=E:\W10UImount"
- >if /I "W10UI" == "W10UI" set "winremount=E:\W10UImountre"
- >if "p" == "\" set "_cabdir=!_cabdir:~0,-1!"
- >if "p" == ":" set "_cabdir=!_cabdir!\"
- >if not "!_cabdir!" == "!_cabdir: =!" set "_cabdir=!_cabdir: =!"
- >if "t" == "\" set "mountdir=!mountdir:~0,-1!"
- >if "t" == ":" set "mountdir=!mountdir!\"
- >if not "!mountdir!" == "!mountdir: =!" set "mountdir=!mountdir: =!"
- >set "mountdir=!mountdir!_5653"
- >set "winremount=!winremount!_4889"
- >set "_cabdir=!_cabdir!_19091"
- >if defined cmd_target if defined cmd_tmpdir if exist "!cmd_target!\Windows\regedit.exe" (
- set "Target=!cmd_target!"
- set "_cabdir=!cmd_tmpdir!"
- set "repo=!_work!"
- if defined cmd_source if exist "!cmd_source!\sxs\*netfx3*.cab" set "Net35Source=!cmd_source!\sxs"
- if defined cmd_source if exist "!cmd_source!\setup.exe" set _offdu=1
- set AutoStart=1
- set _embd=1
- )
- >if 0 EQU 0 if exist "!_cabdir!\" (
- echo.
- echo ============================================================
- echo Cleaning temporary extraction folder...
- echo ============================================================
- echo.
- rmdir /s /q "!_cabdir!\"
- )
- >set _init=1
- >set tmpssu=
- >set _fixEP=0
- >set _actEP=0
- >set _SrvEdt=0
- >set _DNF=0
- >set directcab=0
- >set dvd=0
- >set wim=0
- >set offline=0
- >set online=0
- >set copytarget=0
- >set imgcount=0
- >set wimfiles=0
- >set keep=0
- >set targetname=0
- >set _skpd=0
- >set _skpp=0
- >set uupboot=0
- >if 1 == 1 if "!target!" == "" if exist "*.wim" (for /F "tokens=* delims=" %# in ('dir /b /a:-d "*.wim"') do set "target=!_work!\%~nx#" )
- >if "!target!" == "" set "target=C:"
- >if ":" == "\" set "target=!target:~0,-1!"
- >if /I "!target!" == "C:" (
- if /I amd64 == x86 (set arch=x86 ) else if /I amd64 == amd64 (set arch=x64 ) else (set arch=arm64 )
- if 1 == 1 (goto :check ) else (goto :mainmenu )
- )
- >if /I "!target!" == "C:" (
- set _build=22000
- reg.exe query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v W10UIclean && (set onlineclean=1 & set online=1 & set cleanup=1 )
- reg.exe query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v W10UIrebase && (set onlineclean=1 & set online=1 & set cleanup=1 & set resetbase=1 )
- )
- ERROR: The system was unable to find the specified registry key or value.
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration
- W10UIrebase REG_DWORD 0x1
- >if defined onlineclean goto :main2board
- >if 0 NEQ 0 (echo.) else if 1 NEQ 0 (echo.) else ()
- >echo ============================================================
- ============================================================
- >echo Running W10UI v10.17
- Running W10UI v10.17
- >echo ============================================================
- ============================================================
- >if 1 == 1 (
- net stop trustedinstaller
- net stop wuauserv
- del /f /q C:\Windows\Logs\CBS\*
- )
- The Windows Modules Installer service is not started.
- More help is available by typing NET HELPMSG 3521.
- The Windows Update service is not started.
- More help is available by typing NET HELPMSG 3521.
- >if not exist "C:\Windows\Logs\DISM\" mkdir "C:\Windows\Logs\DISM"
- >if 0 EQU 0 del /f /q C:\Windows\Logs\DISM\*
- >if 0 EQU 0 del /f /q C:\Windows\Logs\MoSetup\*
- >if defined onlineclean (
- if exist "C:\Windows\WinSxS\pending.xml" (
- echo.
- echo ============================================================
- echo ERROR: you must restart the system first before cleaning up
- echo ============================================================
- echo.
- echo.
- echo Press any key to exit.
- goto :eof
- )
- set verb=0
- set "mountdir=!target!"
- set dismtarget=/online
- set _build=22000
- reg.exe delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v W10UIclean /f
- reg.exe delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v W10UIrebase /f
- if not exist "!_cabdir!\" mkdir "!_cabdir!"
- call :cleanup
- goto :fin
- )
- ERROR: The system was unable to find the specified registry key or value.
- The operation completed successfully.
- >set savc=0 & set savr=1
- >if 22000 GEQ 18362 (set savc=3 & set savr=3 )
- >if exist "!mumtarget!\Windows\Servicing\Packages\*WinPE-LanguagePack*.mum" (
- if 0 == 1 (
- echo.
- echo ============================================================
- echo Resetting WinPE image base...
- echo ============================================================
- )
- call :MeltdownSpectre
- if 22000 GEQ 16299 if /I not x64 == arm64 (
- set ksub=SOFTWIM
- reg.exe load HKLM\!ksub! "!mumtarget!\Windows\System32\Config\SOFTWARE"
- reg.exe add HKLM\!ksub!\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v SupersededActions /t REG_DWORD /d 3 /f
- reg.exe add HKLM\!ksub!\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v DisableComponentBackups /t REG_DWORD /d 1 /f
- reg.exe unload HKLM\!ksub!
- if 1 EQU 0 dism.exe /English /NoRestart /ScratchDir:"!_cabdir!" /online /Cleanup-Image /StartComponentCleanup
- if !errorlevel! EQU 1726 dism.exe /English /NoRestart /ScratchDir:"!_cabdir!" /online /Get-Packages
- )
- if 1 EQU 0 dism.exe /English /NoRestart /ScratchDir:"!_cabdir!" /online /Cleanup-Image /StartComponentCleanup /ResetBase
- if !errorlevel! EQU 1726 dism.exe /English /NoRestart /ScratchDir:"!_cabdir!" /online /Get-Packages
- call :cleanmanual
- goto :eof
- )
- >if 1 == 0 call :cleanmanual & goto :eof
- >if exist "!mumtarget!\Windows\WinSxS\pending.xml" (
- if 1 == 1 (
- if 1 == 0 (set rValue=W10UIclean ) else (set rValue=W10UIrebase )
- reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v !rValue! /t REG_DWORD /d 1 /f
- goto :eof
- )
- call :cleanmanual & goto :eof
- )
- >if 1 == 0 (
- set ksub=SOFTWIM
- reg.exe load HKLM\!ksub! "!mumtarget!\Windows\System32\Config\SOFTWARE"
- ) else (set ksub=SOFTWARE )
- >if 1 == 0 (
- echo.
- echo ============================================================
- echo Cleaning up OS image...
- echo ============================================================
- if /I not x64 == arm64 (
- reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v DisableResetbase /t REG_DWORD /d 1 /f
- reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v SupersededActions /t REG_DWORD /d 3 /f
- )
- if 1 == 0 (
- if /I amd64 == x86 if /I not x64 == x86 reg.exe save HKLM\SOFTWARE "!mumtarget!\Windows\System32\Config\SOFTWARE2"
- reg.exe unload HKLM\!ksub!
- if /I amd64 == x86 if /I not x64 == x86 move /y "!mumtarget!\Windows\System32\Config\SOFTWARE2" "!mumtarget!\Windows\System32\Config\SOFTWARE"
- )
- dism.exe /English /NoRestart /ScratchDir:"!_cabdir!" /online /Cleanup-Image /StartComponentCleanup
- if !errorlevel! EQU 1726 dism.exe /English /NoRestart /ScratchDir:"!_cabdir!" /online /Get-Packages
- ) else (
- echo.
- echo ============================================================
- echo Resetting OS image base...
- echo ============================================================
- if /I not x64 == arm64 (
- reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v DisableResetbase /t REG_DWORD /d 0 /f
- reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration /v SupersededActions /t REG_DWORD /d 3 /f
- )
- if 1 == 0 (
- if /I amd64 == x86 if /I not x64 == x86 reg.exe save HKLM\SOFTWARE "!mumtarget!\Windows\System32\Config\SOFTWARE2"
- reg.exe unload HKLM\!ksub!
- if /I amd64 == x86 if /I not x64 == x86 move /y "!mumtarget!\Windows\System32\Config\SOFTWARE2" "!mumtarget!\Windows\System32\Config\SOFTWARE"
- )
- if 1 == 0 if 22000 GEQ 16299 dism.exe /English /NoRestart /ScratchDir:"!_cabdir!" /online /Cleanup-Image /StartComponentCleanup
- if !errorlevel! EQU 1726 dism.exe /English /NoRestart /ScratchDir:"!_cabdir!" /online /Get-Packages
- dism.exe /English /NoRestart /ScratchDir:"!_cabdir!" /online /Cleanup-Image /StartComponentCleanup /ResetBase
- if !errorlevel! EQU 1726 dism.exe /English /NoRestart /ScratchDir:"!_cabdir!" /online /Get-Packages
- )
- ============================================================
- Resetting OS image base...
- ============================================================
- The operation completed successfully.
- The operation completed successfully.
- Deployment Image Servicing and Management tool
- Version: 10.0.22000.1
- Image Version: 10.0.22000.527
- [===== 10.0% ]
- [=========== 19.0% ]
- [=========== 20.0% ]
- [=========== 20.0% ]
- The operation completed successfully.
- >call :cleanmanual
- >if 1 == 1 goto :eof
- >goto :eof
- >if 1 == 0 if 22000 GEQ 19041 if 22000 LSS 17133 if exist "C:\Windows\System32\ext-ms-win-security-slc-l1-1-0.dll" (
- del /f /q C:\Windows\System32\ext-ms-win-security-slc-l1-1-0.dll
- if /I not amd64 == x86 del /f /q C:\Windows\SysWOW64\ext-ms-win-security-slc-l1-1-0.dll
- )
- >call :cleaner
- >cd /d "!_work!"
- >if defined msucab (
- for %# in ((null)) do del /f /q "!repo!\%~#"
- set msucab=
- )
- >if defined tmpcmp (
- for %# in ((null)) do del /f /q "!repo!\%~#"
- set tmpcmp=
- )
- >if defined uuppkg (
- for %# in ((null)) do del /f /q "!repo!\%~#"
- set uuppkg=
- )
- >if 0 NEQ 0 goto :eof
- >if exist "cabmsu.txt" (
- for /F %# in (cabmsu.txt) do del /f /q "!repo!\%~#"
- del /f /q cabmsu.txt
- )
- >if exist "!_cabdir!\cmpcab.txt" (
- cd /d "!_cabdir!"
- for /F %# in (cmpcab.txt) do del /f /q "!repo!\%~#"
- del /f /q cmpcab.txt
- cd /d "!_work!"
- )
- >if exist "!_cabdir!\" (
- echo.
- echo ============================================================
- echo Removing temporary extracted files...
- echo ============================================================
- echo.
- rmdir /s /q "!_cabdir!\"
- )
- ============================================================
- Removing temporary extracted files...
- ============================================================
- >if exist "!_cabdir!\" (
- mkdir E:\_del286 1>nul 2>nul
- robocopy E:\_del286 "!_cabdir!" /MIR 1>nul 2>nul
- rmdir /s /q E:\_del286\ 1>nul 2>nul
- rmdir /s /q "!_cabdir!\"
- )
- >goto :eof
- >if defined tmpssu (
- for %# in ((null)) do del /f /q "!repo!\%~#"
- set tmpssu=
- )
- >if 0 EQU 1 if exist "!mountdir!\" rmdir /s /q "!mountdir!\"
- >if exist "!winremount!\" rmdir /s /q "!winremount!\"
- >if 0 == 1 if 0 == 1 call :ISO
- >if 0 EQU 0 (
- echo.
- echo ============================================================
- echo Finished
- echo ============================================================
- echo.
- )
- ============================================================
- Finished
- ============================================================
- >if 1 == 1 if exist "C:\Windows\winsxs\pending.xml" (
- echo.
- echo ============================================================
- echo System restart is required to complete installation
- echo ============================================================
- echo.
- )
- >if 0 NEQ 0 goto :eof
- >if 1 NEQ 0 goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement